Adds support for passing flags to New()

It also has a minor fix to report magic cookie allocation errors.
Would you like to convert this file into a test file as an example, so it appears on Godoc?

A sample is available on https://github.com/golang/oauth2/blob/master/example_test.go for oauth2 package.