Adds support for passing flags to New()

It also has a minor fix to report magic cookie allocation errors.
You can use magicmime namespace if you add a `_test` to the package name. See it in action on https://github.com/golang/oauth2/blob/master/example_test.go#L1