Implements various new features

Hopefully the last of the mega-branches.