added pause/resume functionality

implemented pause, resume, startOrResume, isStarted and isPaused methods.

see example/main.js changes for details.