WIP: partial-based pyll

I cleaned up the code I had and isolated it, I'm going to start grafting it into the existing implementation, what I had was pretty ugly, but have a look at this so far if you like.