first mostly working version of MultiLayerNetworkOptimizer, needs one last fix - WIP