added download function using github api.
refactored download and merge into separate classes to improve readability.
introduced arguments for use with tests and to enable script to be called with existing system-config.json.
added groovy version comment.