Lots of work

- Work on caching
- Reduced warnings
- etc.