New RPATH logic (ready for review)



<!---
@huboard:{"order":669.5,"custom_state":""}
-->

Ah, this isn't Python 3 compatible either. I guess none of the code in the second half of this file is doctested.