getdata(cmd) will return a generator that yields every token on every line that starts with the token "cmd". getdata(cmd, mode="lines") will yield a list for each line rather than every individual token. this simplifies some things in __init__.py.
New mako template returns unicode strings, which are a problem for shlex. We need to encode them to ascii.