GROOVY-5898: Sql.java throws IllegalStateException when comments contain quotes

I thought extracting the inner `ExtractIndexAndSql` class would be a good idea so its parsing logic could be tested separately from having to hit a database.  With this change there are probably other tests that could be moved into `ExtractIndexAndSqlTest` to avoid the db hit, but for now I thought it was best to to leave existing tests as is.