Refactoring so that functions javascript functions created for subscript...

...ions can be reused for watch and vote.