Major refactor. Move stuff into tools modules