Cleanup, theme support, pdo class, removed redbean, removed variables

Cleanup of codebase, multiple theme support, pdo abstraction class with
multi database support, removed RedBean from core, removed variables
class so we're not depending on a specific db