-added resource caching
-misc fixes