many changes which I should have done in incrementatl commits :(

these changes should make usage of the tool easier and writing plugins
easier,but old stuff may be broken