Added next tick functionality

Added code to allow a callback to be set to be called on the next tick. Refs #92.