set dimension and metric calls to js

Added js prototypes for setDimension and setMetric calls.