Fixes db namespace bugs.
Moves markdown to library.