Working editor controls now, need to tidy up the code and write tests so we can merge to master