restructure selftest to use php on cli