Lots of minor fixes/improvements to support functionality even with missing dependencies

Also fixed a number of bugs revealed by testing this way.

This pull request has the std-alloc request also merged in (I hoped it would come afterwards), but those can be separated if necessary.