Use change of position of cursor instead of DeltaX/Y from event.

This fixes an issue where scrolling paste the edge of a screen will
keep moving or resizing windows.
Use real-time scheduling for worker threads.
Remove __bridge annotations since we'll be compiling sans ARC.
Use #pragma once instead of #ifdef guard in config.h.
Major refactoring/cleanup of codebase.