Allow captureData to be called more than once.

Calling captureData again will reset the internal buffer.
Add startCapture, stopCapture, clearCapturedData.

Deprecate captureData.