Added example HTML page for testing.
Bit of refactoring and some bug fixes.