ui/editor: Refactor resize and move handlers

This pulls out the resize and move handlers into separate components
that are rather easier to understand. It also adds test suites for each
of them.