Cloud Foundry compatibility and friendly relative script paths

Local Cloud Foundry (VCAP) compatibility
Shorten friendly scripts path
Fixed object undefined bug