Minor fixes

Allow configuration of database name.
Rewrite from sapphire to framework.