Use the non-deprecated createGenerator and createParser

.createJsonGenerator and .createJsonParser are both deprecated.

This also adds more type hints for the arguments.

Fixes #72