Refactored a lot of code.
Added tests for all exceptions. They all check out.
used different data structures for stuff. Now using hashmaps a lot,
seems to have improved speed.