refactoring and finished integration of doubletreeJS