Moved postgresql specific functions into separate class
Added writer for MySQL and fixed run time errors

Apparently cannot mark the variables as private