Bugfixes, implement a hooks dict to maintain handlers for widgets