Move most of sensu.js logic to angular