WIP! More Piper code

This is under some fairly heavy development so I don't promise everything is coherent.
maybe a bit of error handling? Config file wrongly formatted or missing basically