refactored code
added options
removed old test code
fixed browser example