Bugfix, caching multiple instances and code rewrite and documentation
Resuming last commit