Created a separate file arduino.js and rewrote the scriptable example
Updated scriptable demo