Upgrade AMS and reflect API changes

Context layer delegates everything to layer so we don't feel
like manipulating two objects just to get some intermediate attribute.
Modify the api and javascript to communicate with it accordingly with
changes due to AMS upgrade