Improved and exported prepend-webapp-path function