Reapply of KM p/r squashed commits
Merge pull request #48 from alexeykudinkin/master

Reapply of KM p/r squashed commits