Implemented UI hooks.
Changes following CR.
Merge pull request #6 from my-koop/mg_uihooks

Implemented UI hooks