extract LazyArray (formerly in core.rb)
and refactor module structure