Remove statics/globals in favor of an instance-based approach

Not all of the tests and examples have been migrated but I wanted to see if you had any comments on it first.

I've kept a shim implementing the old interface so it *should* be completely backwards compatible with existing code. The only exception being the servlet filter interface which now takes the instance as an argument.