chore(engine): add EnsureUtil to ensure variable conditions
chore(engine): fix typos, rename functions and reformat docs

related to #CAM-2189, #CAM-2190, #CAM-2191, #CAM-2192, #CAM-2194,
  #CAM-2195, #CAM-2197
fix(engine): fix some potential null pointer exceptions