func (j *Json) Wrap(path string) *Json {
	wrap := New()
	if !wrap.Set(path, j) {
		return Nil()
	}
	return wrap
}
Wrap the current json to a new json
Example : { "pi": 3.14 }.Wrap("const") => { "const": { "pi": 3.14 }} }
Returns the new parent or nilJson if error
package jsonmap
import (
	"encoding/json"
	"errors"
	"reflect"
	"strconv"
)
type Json struct {
	data interface{}
}
type Jsonizer interface {
	JSON() *Json
}
func jsonize(j Jsonizer) *Json {
	if j == nil {
		return Nil()
	}
	if rv := reflect.ValueOf(j); rv.IsNil() {
		return Nil()
	}
	return j.JSON()
}
func New() *Json {
	return &Json{
		data: make(map[string]interface{}),
	}
}
func Nil() *Json {
	return &Json{nil}
}
func FromBytes(bytes []byte) *Json {
	j := new(Json)
	j.UnmarshalJSON(bytes)
	return j
}
func FromString(str string) *Json {
	return FromBytes([]byte(str))
}
func FromMap(m map[string]interface{}) *Json {
	return &Json{
		data: m,
	}
}
func (j *Json) Stringify() string {
	return string(j.Bytes())
}
func (j *Json) Bytes() []byte {
	bytes, _ := j.MarshalJSON()
	return bytes
}
func (j *Json) MarshalJSON() ([]byte, error) {
	if j.IsNil() {
		return []byte("null"), nil
	}
	bytes, err := json.Marshal(j.data)
	if err != nil {
		return []byte("null"), err
	}
	return bytes, nil
}
func (j *Json) UnmarshalJSON(data []byte) error {
	if j == nil {
		return errors.New("unmarshal JSON on a nil pointer")
	}
	return json.Unmarshal(data, &j.data)
}
func (j *Json) Data() interface{} {
	return j.data
}
func (j *Json) IsNil() bool {
	return j.data == nil
}
func (j *Json) IsObject() bool {
	_, ok := (j.data).(map[string]interface{})
	return ok
}
func (j *Json) AsObject() map[string]interface{} {
	if casted, ok := (j.data).(map[string]interface{}); ok {
		return casted
	}
	return nil
}
func (j *Json) IsArray() bool {
	_, ok := (j.data).([]interface{})
	return ok
}
func (j *Json) AsArray() []interface{} {
	if casted, ok := (j.data).([]interface{}); ok {
		return casted
	}
	return nil
}
func (j *Json) IsValue() bool {
	return !j.IsNil() && !j.IsObject() && !j.IsArray()
}
func (j *Json) AsString() string {
	if casted, ok := (j.data).(string); ok {
		return casted
	}
	return ""
}
func (j *Json) AsBool() bool {
	if casted, ok := (j.data).(bool); ok {
		return casted
	}
	return false
}
func (j *Json) AsInt() int64 {
	switch j.data.(type) {
	case json.Number:
		if i, err := (j.data).(json.Number).Int64(); err != nil {
			return i
		}
		return 0
	case float32, float64:
		return int64(reflect.ValueOf(j.data).Float())
	case int, int8, int16, int32, int64:
		return reflect.ValueOf(j.data).Int()
	case uint, uint8, uint16, uint32, uint64:
		return int64(reflect.ValueOf(j.data).Uint())
	default:
		return 0
	}
}
func (j *Json) AsUint() uint64 {
	switch j.data.(type) {
	case json.Number:
		if u, err := strconv.ParseUint(j.data.(json.Number).String(), 10, 64); err != nil {
			return u
		}
		return 0
	case float32, float64:
		return uint64(reflect.ValueOf(j.data).Float())
	case int, int8, int16, int32, int64:
		return uint64(reflect.ValueOf(j.data).Int())
	case uint, uint8, uint16, uint32, uint64:
		return reflect.ValueOf(j.data).Uint()
	default:
		return 0
	}
}
func (j *Json) AsFloat() float64 {
	switch j.data.(type) {
	case json.Number:
		if f, err := (j.data).(json.Number).Float64(); err != nil {
			return f
		}
		return 0
	case float32, float64:
		return reflect.ValueOf(j.data).Float()
	case int, int8, int16, int32, int64:
		return float64(reflect.ValueOf(j.data).Int())
	case uint, uint8, uint16, uint32, uint64:
		return float64(reflect.ValueOf(j.data).Uint())
	default:
		return 0
	}
}
func (j *Json) Get(path string) *Json {
	keys := createPath(path)
	curr := j
	for _, k := range keys {
		if o := curr.AsObject(); o != nil {
			val, ok := o[k]
			if !ok {
				return Nil()
			}
			curr = &Json{val}
			continue
		}
		if a := curr.AsArray(); a != nil {
			idx, e := strconv.Atoi(k)
			if e != nil || idx < 0 || idx >= len(a) {
				return Nil()
			}
			curr = &Json{a[idx]}
			continue
		}
		return Nil()
	}
	return curr
}
func (j *Json) Has(path string) bool {
	o := j.Get(path)
	return !o.IsNil()
}
func (j *Json) Set(path string, value interface{}) bool {
	keys := createPath(path)
	lastIndex := len(keys) - 1
	var newValue interface{}
	switch cv := value.(type) {
	case Jsonizer:
		newValue = jsonize(cv).data
	case *Json:
		newValue = cv.data
	case []*Json:
		datas := make([]interface{}, 0, len(cv))
		for _, item := range cv {
			datas = append(datas, item.data)
		}
		newValue = datas
	case []interface{}:
		newValue = cv
	default:
		rv := reflect.ValueOf(value)
		kind := rv.Kind()
		if kind == reflect.Array || kind == reflect.Slice {
			l := rv.Len()
			datas := make([]interface{}, l)
			for i := 0; i < l; i++ {
				val := rv.Index(i)
				if !val.CanInterface() {
					continue
				}
				if jsonizer, ok := val.Interface().(Jsonizer); ok {
					datas[i] = jsonize(jsonizer).data
					continue
				}
				datas[i] = val.Interface()
			}
			newValue = datas
		} else {
			newValue = value
		}
	}
	if lastIndex == -1 {
		j.data = newValue
		return true
	}
	curr := j
	for i, k := range keys {
		if o := curr.AsObject(); o != nil {
			if i == lastIndex {
				o[k] = newValue
				return true
			}
			if _, ok := o[k]; !ok {
				o[k] = make(map[string]interface{})
			}
			curr = &Json{o[k]}
			continue
		}
		if a := curr.AsArray(); a != nil {
			idx, e := strconv.Atoi(k)
			if e != nil || idx < 0 || idx >= len(a) {
				return false
			}
			if i == lastIndex {
				a[idx] = newValue
				return true
			}
			curr = &Json{a[idx]}
			continue
		}
		m := make(map[string]interface{})
		curr.data = m
		if i == lastIndex {
			m[k] = newValue
			return true
		}
		m[k] = make(map[string]interface{})
		curr = &Json{m[k]}
	}
	return false
}
func (j *Json) Unset(path string) bool {
	keys := createPath(path)
	curr := j
	lastIndex := len(keys) - 1
	for i, k := range keys {
		if o := curr.AsObject(); o != nil {
			if i == lastIndex {
				delete(o, k)
				return true
			}
			val, ok := o[k]
			if !ok {
				return false
			}
			curr = &Json{val}
			continue
		}
		if a := curr.AsArray(); a != nil {
			idx, e := strconv.Atoi(k)
			if e != nil || idx < 0 || idx >= len(a) {
				return false
			}
			if i == lastIndex {
				a[idx] = nil
				return true
			}
			curr = &Json{a[idx]}
			continue
		}
		return false
	}
	return false
}
func (j *Json) Rewrite(oldPath string, newPath string) bool {
	d := j.Get(oldPath).Data()
	return j.Unset(oldPath) && j.Set(newPath, d)
}