Overhaul with new .squares namespace
A few minor cleanups and needless optimizations