Add createtable command to index + some fixes & cleanups of db
Some spacing and identation fixes.
WIP: Tests for different usages of postgres.