Fixed assets.json example and added basePath to this
Implemented functions on prototype instead of this, separated code