[core] various refactoring:

* Use ruby19 hash syntax
* Add lambda to scopes