Merge PHP branch into trunk (master).

This merge rewrites all code from Busybox Ash shell script to PHP code. While a lot of this code remains untested in the wild, it has been solid and improved over the last couple of days. Hopefully it'll be implemented in the coming days as final.