Mostly done refactoring, a few cleanups to do.
Small cleanups, removed x/y attributes.