Added ability to drag windows.
Put mouse position setting in a different thread.