Significantly reduce library footprint

Closes #1. Closes #2.