Codebase complete

Testing and tweaks required