Performance improvements

- lazy evaluation where possible
- removed assertions from critical spots
- based on measurements on node.js