More dB updates, along with sma-database class (currently untested)