Cleanup, formatting, const correctness

Sigh