Made OpenStats work (sort of)

OpenStats now works as expected, some cleanups are necessary, though.
Next step is to remove the old tables without the oh_ prefix and fix the installer.