Generaized, cleaned up, and commented the Widget class.