Refactored core for mruby_set{,code} directive