Ported to PHPixie2

I may have missed a few places, but I think I ported everything =)