Convert entry point to use explicit globals

When installing the extension with composer, the entry
point is not included in filescope, so any global variables
must be made explicit by using $GLOBALS.

Change-Id: I15cc8ac2b5008364d958a2d847823124c1f27993