Added test and example files. Tweaks to js files. Updated documentation.