Merge tag 'v2.1' into develop

Fixed query to avoid injection and stop being dumb
moved all vars to config file and simplified db
moving functions to config class
Merge branch 'release/v2.2'