Real database on board (although sqlite); Code refactored to get rid of redundant context-switching;