simplify demo JavaScript.
add example, update API documentation to fit version 1.1.0