Fixed broken installation procedure on Linux and OSX
Fixed install scripts too
Refactored IO out of gmpublish