Big codebase re-write. Built in lots of error control.