added profile for cdh5, updated deps for cdh4
major refactoring for cdh compatibility
refactoring, almost got it to work