Introduced sqlite3 database code.
Started pulling out image handling code into model.