Fixes #2119 - Properly support colon-separated modulepath

We were not properly handling module paths with colons in. Due to a bad regex (/\$environment.*/,'/') the secondary paths are dropped, and then lost when Dir can't find the first parent.

Best viewed with ?w=1 as indentation has changed ;)