Bit of a tidy-up, and the beginnings of an SQLite database