push revision number
rewrite threading system

mysql_close is now always waiting for queries to be finished before closing the connection