Mauro and Adam and James refactored stuff

This is the latest and greatest kopokopo changes with better style, more tests