Convert network to a template

The general idea is that I need the network to be a template so I can
avoid a bunch of type-casting inside users of this library.  It's a
bit unfortunate, but I guess I'm stuck with it for now...
Convert path to a template