Issue #887/#888

The PR includes fixes for #887 and #888 (file vesron).
@pecko - we introduce lots of new imports here.  That is a sign that we've added lots of functionality.  Could you refactor some of the new code into another class that gets called from Startup?