Implemented proper cache system, added tests, expressions support cloning, misc fixes, more tests