Improve test-prod parity for storage dirs

We now only override the base storage dir, not the full storage path.  This enables the path calculation logic to be covered by tests.

This also fixes a bug where the path segments would skip over any non-digit chars (i.e. a-f) in the id.  As a result, there is a manual fixup task to be done after deployment to fix the storage dirs for any assets that have a non-digit in the first 4 chars of their id.