Added all the code from the demo. Need to rewrite some to conform to quagga format.