Submitted to HotSDN. Will not work on the code for a while.