Redefining Elixir Core modules in Mix project

I am working on a fix for Elixir core, and I would like to know what is the best way to redefine an Elixir Core module. In this case if Protocol.

Basically what I am doing is copying the original Protocol module, and adding my modifications inside a Mix project for the ease of development.
I would like to know if there is a way I can execute at the beginning of a the compile mix task so I can code (:code.purge, :code.load_file, :code.load_abs), or define an order of execution so when (in this case) defprotocol is called, It is called from my new module, and not from Elixir Core.

Thank you.

I see that just adding the :code calls to to mix.exs does the trick.