Refactor Pin class and clean up
Changing create method to take a generator function.

This removes the dependence on co for the users of this module.