Update cloth.js

- added new helper functions and classes
- changed structure of library