Phyrworks master

Rebased Phrworks pull request with minor mods e.g. removing autogenerated comments.