Feature/fix version method

Note: this PR is based on @kevinsimper's https://github.com/kevinsimper/Crafty/tree/commonjs branch, so if accepted it should be merged only after #568