Various additions

Heaps of functionality that needs to be cleaned up.