Added add/getLocations and a way to conveniently view the tables.

Also did some code refactoring.