Outside framework handling

Quick pull request:
- Added InvalidFrameworkException for better error handling
- Caching of FrameworkInstance (shaves off about 20ms per request)
- Outside use of Framework Classes