moved general functions to GFunc, now using PyDatabase for database functions. Better log function for output instead of print