move db
add db-writer skeleton (consumes the messages). refactored a little bit, switched everything to km and passed some extra data to the analyser to pass through all the way to the db-writer