Use SQLite for storage of training data


Hopefully fixes memory issues from #14