Misc work on the web interface, optimized saving to db