Revert "Revert "Added most of core classes and db handler (I will finish this tomorrow morning)""

This reverts commit a4796d9afb6cb19ac7f1a7220d9fca7a243a6cc2.