Rearrange dependencies
Add new main activity and add db support to it
Fix a couple db syntax errors