Made various improvements to module exports and context logging.