Added some parameters to check if the script is executed directly.

Also fixed an issue with the require rest client gem. This was just
to get the script to run.