Fix issue where recursive building only worked for first level of missing dependencies.

Somehow it slipped past me that when I moved the recursive building into `main_build.py` from `build.py` it stopped working for more than one level of dependencies. I've fixed that and reduced some code duplication by making the dependencies just get added to the list of recipes to build on the fly, instead of explicitly calling `build.build` and `build.test` again.