Fixes #30, mostly. Its definitely much better.

Maybe I should still look at and revise attackgoingtobstacle(), but if
so that's for a later commit