Workflows: moved approval related functions to approval.js