Cleaning for proper plugin-ize and database.

Paving the way for #133 and a better plugin system.