WIP: refactor and de-cruft ngHal for embedded and link changes
refactored for multiple contexts