Lots of changes!

Lots of changes made here! There are small fixes and alterations to be
made, but this essentially completes version 1.