zones, subscribe and unsubscribe support

XWALK-865

Can u move these to bottom of this function? (declaration close to first use)