A few rewrites and style updates

Kinda been hacking at this slowly, was working on old versions of master for a while so didn't feel like uploading for a while. Hope it's not too overwhelming to review.