Refactoring

Deleted WeightedGraphFlow and refactored engine and chain protocols