Cleanup

Cleanup plus yesterdays pull request merged in this one (db reorganisation[auto])
Currently trying to work on the hashmap stuff, quite annoyed at it not cleaning itself up properly.
Working on something along those lines atm