Faster enumerations

This pull request is based on all previous pull requests: #21, #22, #23.

I am really sorry for this mess with so many PRs - I do them by inspiration and can't foresee all the future ideas&changes when I am at earlier stages.