Move old tests to test/legacy.

These tests are useful for old compatibility, but are really
complex and bad. let's move them to run in CI.