javascript updates

templates collection added
regular fixes
another fix