Ported contains_line() to XS