Support emitting analytical events from xblocks running in the LMS

XBlocks can and should use the "publish" method provided by the runtime to
emit analytical events. In theory we could now start replacing calls to
track_function with calls to publish, however, that migration is not handled
by this change.

Fixes: AN-789
Reviewers: @cpennington, @ormsbee
FYI: @rocha, @brianhw