Lots of code tweaks for new directory format and function-based scraping.