Removed the onTimeElapsed option, improved documentation and comments.
Merged demo files.