Preliminary refactor to allow group editing. Not done!

#7