Galleries can be entered into the database

Added forms, ajax, styles etc.
On top of the database insertion, some code cleanup.
Database gets removed on uninstall
Minor irrelevant changes