lots of little fixes as the by-hand testing progresses, meshing almost working
last fixes to make basic meshing working