WIP! More Piper code

This is under some fairly heavy development so I don't promise everything is coherent.
Can [this](http://stackoverflow.com/questions/4223654/how-to-ensure-that-a-python-dict-keys-are-lowercase) be useful?