use codecs.open, and strip -*- coding

- open things in utf-8
- strip -*- coding lines as they break ast.parse/compile
line lengths