General changes pulled from the Bukkit repository

These changes shouldn't break glowstone if pulled, but should be implemented as required. This PR is simply opened as a reminder to myself that these changes exist until pulled.

Credit to:
- [Bukkit #1070](https://github.com/Bukkit/Bukkit/pull/1070)
- [Bukkit #765](https://github.com/Bukkit/Bukkit/pull/765)
- [Bukkit #1051](https://github.com/Bukkit/Bukkit/pull/1051)
- [Bukkit #777](https://github.com/Bukkit/Bukkit/pull/777)
- [Bukkit #785](https://github.com/Bukkit/Bukkit/pull/785)
- [Bukkit #840](https://github.com/Bukkit/Bukkit/pull/840)
- [Bukkit #873](https://github.com/Bukkit/Bukkit/pull/873)
- [Bukkit #1022](https://github.com/Bukkit/Bukkit/pull/1022)
- [Bukkit #1002](https://github.com/Bukkit/Bukkit/pull/1002)
- [Bukkit #1039](https://github.com/Bukkit/Bukkit/pull/1039)
- [Bukkit #827](https://github.com/Bukkit/Bukkit/pull/827)

Thank you to everyone who has contributed. Sorry if you PR wasn't pulled in Bukkit :(

Contributors: 
- @KodekPL
- @mcmonkey4eva
- @gmcgerrin
- @zaiyers
- @YLivay
- @EdGruberman
- @shineyquagshire23
- @Aaron1011
- @Ribesg