restructure index.php and call worker if started with '-j' option