Major restructure. Incorporate better Cakefile and pass all tests.