Moved MonadDB class and instances into separate file

Still needs documentation.