Fixed handling of cataphoric variables

In some cases the data has variables that are used before being
explicitly defined. Previously these were treated as literals.

Now, we maintain a list of such cases, and fix them once possible.