Move more code to Elixir land, simplify serialization
Port module_nesting handler to Elixir