some code cleanup and refactorings, added initial crude version of code that starts the db server