Added encoding to scanlines()

Still wish I could figure out how to make the encoding parameter
completely optional, rather than having to type None or whatever else I
choose. TODO: look at official modules and see how they do it.