No real changes yet, this commit just prepares for adding support for per-monitor DPI by reorganizing some code.