Lots of changes

Lots of changes - check out the commits involved. Enjoy