Support elixir 0.15.0-dev and new logger
Only compile-time optimize queries for local or required modules

This removes a possible deadlock because of circular dependencies
between models created by Code.ensure_compiled?/1.

Closes #252.