Moving transactions into js/gitana