Changed syntax
Use underscore.js and string arguments
Publish files field and removed default parameters in cachedFilename and url
Simplified logic in  cachedFilename
Use random ids
Check for ghostScript setting