Fix task to load two basic models
MAJOR FIX: Prevent recreating network

Synchronize input dataports.
Prevent from dividing by 0 by casting results of various
calculations to double.
Add intensive debugging logging.
Fix some minor issues with variables' scopes.