Updated functions to work better with errors, installer and controllers.
Added the SQL file containing all the tables for future reference.
Fixed some syntax.