Here are my thoughts as someone who has dealt with oversuplly/imbalance for YEARS (I have breastfed 5 babies).
It does sound like foremilk imbalance with the green poo and gas. Also that it cleared up when you nursed from the same breast all day. Just because you don't have overactive letdown (milk spraying everywhere like a firehose) doesn't necessarily mean you don't have oversupply. The two are often connected, but not always.
Since nursing from one breast for more than four hurs DID help, I would suggest you continue to do that, and try NOT to pump too much from the other breast unless you need a freezer stash, or you want to donate. Pumping will increase your supply, and with oversupply you want to decrease it just a bit.
Another option to consider is milk allergy.
I know, it's not a nice thing to hear, but green stools CAN be part of a bigger picture that indicates milk protein allergy. I have 2 kids with milk protein allergies, so I've dealt with THAT can of worms a lot too.
IF the green stools are being caused even partly by milk protein sensitivity, giving him milk-based formula could be a DISASTER for his digestive system!
I'm not trying to tell you what to do, just offering thoughts based on my own experiences, but I STRONGLY urge you not to give him formula. Your milk is far better for him, and easier to digest. Some babies are slow to gain weight, as long as they ARE growing that is OK. Some babies are in the lower "percentiles" on the growth charts, well guess what? Some ADULTS are shorter/smaller than average, like me! All 5' of me!
I really think a few weeks off of dairy to see if that helps is a good idea. I know it's hard. I know! But we keep saying we'd do anything for our babies... here's our chance to prove it! When you think about it, which do you love more: cheese/milk? or your baby? Duh, no-brainer. That really helped me when I was feeling a martyr complex coming on about my dairy-free diet.
I hope your baby is feeling better soon!