Move tail call optimisations to compile.c.

This might work, needs more testing.