Breaking the extend functionality out into several smaller modules. Adding documentation and thowing errors. Starting up on some tests.