Addresses issue #724.
But much smaller and memory-efficient. Uses Python builtin data structures (dict, tuple, int) to describe structure layout.