Added new database class

Database class to handle all the locations. To minimize data traffic we
should save the locations in a database instead of constantly
downloading them.