Re-introduced caching. Added more tests to get coverage up... (96%
now!).