added more tests and code to accept /w/index.php also. refactored split(..)
refactored, added more tests