separated tests from main html file, moved main js into widget.js
added more unit tests