1. How does the bitcoin foundation get agreement from all the miners to implement their changes to bitcoin?
The Bitcoin Foundation plays no formal role in the development of Bitcoin. The foundation is a 501(c)(6) professional organization created fairly recently (last year) in order to help sponsor and promote Bitcoin. If the foundation did have control over Bitcoin it would be very bad indeed, as they could be ordered to abuse that control. Fortunately, they do not. If you wanted you could start your own Bitcoin foundation.
2. When this agreement happens, does the network have to shut down?
3. How quickly does it take to implement these "developer changes"
4. If an entity controls 51% of the network, do they get to be the "developer" ?
Bitcoin is, foremost, an autonomous zero trust system. Every Bitcoin node such as the reference client software (Bitcoin-QT), run by anyone who wants to, independently validates that the messages they receive from the network conform to all the rules written in the software they trust no one. As such, "majority" is generally irrelevant in terms of the system's rules. They cannot be violated by just a simple majority of anything... though if some kind of super-majority of Bitcoin _users_ wanted to adopt different rules, they could: they would arguably be using another system though.
Unfortunately, there is no way to decide the ordering of events in a decentralized and purely autonomous manner, so Bitcoin uses a computational majority to order transactions via mining... Ordering is powerful but the inability to control more than ordering is believed to be part of the incentive balance that keeps mining mostly honest.
As of yet, we've (the Bitcoin community) never really changed the system in a way that wasn't backwards compatible with the earlier versions at least at the rules level— save one exception which was that versions prior to 0.8 would non-deterministically refuse to validate some blocks processing large numbers of transactions and fixing this bug was a not-completely-backwards-compatible change to the system rules.
It's possible to add new restrictions to the rules without breaking backwards compatibility (e.g. transactions not consistent with the new rules are just ordered infinitely far into the future) and this has been done a couple times to correct bugs and provide some new functionality. To make these changes safely it requires a decisive super-majority of mining to be enforcing the new restrictions. Fortunately the protocol itself can coordinate this by miners signaling with a bit in their blocks that they will start enforcing the rules when— say— 750 of the last 1000 blocks have the signal bit.
Anyone who wants to can develop Bitcoin software, and many people— advisably other otherwise— have.