Relations edit/new refactor, lots of small code changes.