Significantly reduce size of library footprint

Closes #1 and closes #2.