Cleaned up the code using functions for colored echoing. Added some minor fixes for OSX based PostgreSQL installations