Update calcmodel.js

added methods to query on state and to calculate.