Big cleanup

Removed a lot of unncessary code documentation and made other parts
clearer. Fixed all exception calls so that they actually use a
namespace - otherwise throwing an exception would have generated a
fatal error.