Add weighted graph concepts.

Super-broken right now; need to rewrite the testing harness.