Added loads of documentation; more class restructuring.