validate = def =>
    Either.of(def)
      .chain(
        def =>
          Immutable.Map.isMap(def.get("props"))
            ? Either.Right(def)
            : Either.Left('"props" key must be an object')
      )
      .chain(
        def =>
          Immutable.Map.isMap(def.get("aliases"))
            ? Either.Right(def)
            : Either.Left('"aliases" key must be an object')
      )
      .chain(
        def =>
          Immutable.Map.isMap(def.get("global"))
            ? Either.Right(def)
            : Either.Left('"global" key must be an object')
      )
Validate that a definition is correctly structured