Add example HTML page
Refactor so that only the 3 public API methods are exported