Finished x11 callback refactoring.
Fixed thread saftey issue and other bugs with xrandr listener.