high dpi (retina/etc) support, mild refactoring

the big blocks of diffs are just me moving a couple things into functions. tested on 15" retina mbp, works fine. neat project!