add command handler for cqrs; move database supports out of the core