Most of #4

Most support. Only tested on PHP.