Some refactoring. Added an auxiliary function.
Added barebone of first instance of class WeightedGraph.