Started work on database integration. Cleaned up caching of thumbnails and improved performance of the thumb path method.