optionally use libmagic for better MIME-type guessing; fixes #4

Fixes #4.
CC: @rajivm @dlindquist for review