Fix for issue #818 

Should fix the stats.js "routing" issue if deployed in a virtual directory https://github.com/NuGet/NuGetGallery/issues/818 

Whooops... Just noticed now that this PR also contains @danlius changes. Can't figure out how to clean up his PR now - sorry! My changes were only in the stats.js and layout.cshtml - hope this helps.