Use rake spec to run tests instead of rspec spec [ci skip]
[core] various refactoring:

* Use ruby19 hash syntax
* Add lambda to scopes