improve StateViewer from inside and outside

This refactors the StateViewer to improve the style (that's for the
outside), the current style making my eyes hurt. In addition, it
also refactors parts to:
 - avoid abusing classes by setting instance variables on them
   when using define_method is enough
 - avoid creating a task inspector until it is needed
 - renaming port_name to task_name since ... it is a task name
Merge pull request #13 from rock-core/improved_state_viewer

improve StateViewer from inside and outside