improved widget API - module pattern, private data and better inheritance