Allow context to be passed into callbacks. Closes #1.