Encapsulation of js tools