This basically transplants the repository into ext/. There are cleaner ways we can do this (by actually folding the code into the right places) but this will suffice for now to solve the problems.