Reformat stubs source code as array of lines.

Implement reset button functionality. Fixed #3