much progress on avoid

also some util functions
Merge branch 'master' of https://github.com/jackflips/chiller-z