Tidied up a bunch of code and added some exceptions. Also implemented
logging. Now to add Eq, then Doubles!