I finally figured it out! It was a combination of needing the App_Code in the system.webServer handlers and an issue with your original code.
|string path = String.Concat(context.Request.ApplicationPath, "/libraries/my_lib_here/");
On my local dev environment, context.Request.ApplicationPath returns "/deploy". In a production mode running it's own domain, context.Request.ApplicationPath returns "/". So the end result of the path variable is "//libraries/my_lib_here/" which will never occur. So a simple fix to work in both environments is:
|string path = String.Concat(context.Request.ApplicationPath, "/libraries/documents/").Replace("//","/");
Thanks for all your help, I'm glad I was able to get it to work