Add parser for network consensus files.

While we're at it, abstract some code to util.go which dissects text
files for us and hands the resulting string chunks to the respective
parsing code.