This patch contains the relatively safe part of my Alembic-related work of the past weeks. There are a lot of cleanups, clarifications and fixes.
Here is a test file, together with scripts that show how I exported & imported it. Please also take some creativity in creating your own test files, to see what I missed ;-)
T50403 also contains a test file that can be used here. Even though these fixes don't close that ticket yet, the file already imports with much less issues than in master. I'll have to dive deeper into that file to see what's still going wrong, though.