Refactor lib into dual node/angular lib