Convert hadoop builds to the ruby script

Tested on a branch, ready for integration.