Replaced rake tasks with file tasks

Refactored rake script to use file tasks instead of normal rake tasks to
better resolve dependencies (dont redownload pre-existing things).
Loading modules ENV via script