Context refactor

Added documentation to the context module.
Made a multiprocess-safe context generator object.
Fixed a newline in token module.