begin: move global vars to sqlite table
switched config vars to settings class
some housekeeping and bugfixing
added more tests