Implemented sorting functionality, refactoring

Moved hooks into an independent object, added dragging between areas
(layers) based on coordinates functionality. Sorting functionality
handled through Sorter.