Refactoring

* moving the main program to function 'main()'
* extracting the GSAT login to a self contained object