Close #42. Thanks to @YasuhiroYoshida for initial implementations.
Merge branch 'enhancement-42'