Add a test with cycles that immediately uses an import from it.

Also fix the commonjs formatter to work in such a case.