various improvements - not quite done
Got dependencies working, sort of
A long set of changes