Add variable to pen API to see simulation status, and more! for #24
Also: Move serialport connection to its own function, handle disconnects using the close event (fixes #14) and turns on simulation mode.