[agent] refactor patchDefine

It became pretty clear that `patchDefine` was a hot mess as I was writing some issues and couldn't describe where things went. As a result, I sat down and tried to separate out the spaghetti.

Here's what it looks like [now](https://github.com/jasonLaster/marionette.inspector/blob/refactor-define/extension/js/agent/patches/patchDefine.js). There's probably still spaghetti, but my how things improved. 

tasks:
+ wrap the patchDefine in a closure
+ extract patchFactoryFunction function
+ add lots of comments