lots of work on trait implementation in javascript
added repr function