CLeared up some bugs produced by forking the code. Most of the way through restructuring it.