Revamped database interaction with contentprovider

Also removed unnecessary files