preliminary impl of wrap_lines; not fully working yet
fixed all wrap_lines unit tests. There are more tests to be written, and some will likely fail, so I don't think this is a perfect implementation. But it passes a few sanity checks.