First implementation of messaging adapter
Reformat database adapter code