diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6398392b86dd826a97e166154134aac4fe780c00..0e91f2683af6122230108f902e228b477b1c8c23 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,8 +88,8 @@ opt(TAUCS "Enable Taucs linear solver" ${DEFAULT})
 opt(TCMALLOC "Enable libtcmalloc, a fast malloc implementation but that does not release memory" OFF)
 opt(TETGEN "Enable Tetgen 3D initial mesh generator" ${DEFAULT})
 opt(VORO3D "Enable Voro3D (for hex meshing, experimental)" ${DEFAULT})
-opt(WRAP_JAVA "Enable generation of Java wrappers (experimental)" OFF)
-opt(WRAP_PYTHON "Enable generation of Python wrappers" OFF)
+opt(WRAP_JAVA_DEPRECATED "Enable generation of Java wrappers (deprecated)" OFF)
+opt(WRAP_PYTHON_DEPRECATED "Enable generation of Python wrappers (deprecated)" OFF)
 opt(ZIPPER "Enable Zip file compression/decompression" OFF)
 
 set(GMSH_MAJOR_VERSION 3)
@@ -102,6 +102,11 @@ set(GMSH_VERSION "${GMSH_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION}")
 set(GMSH_SHORT_LICENSE "GNU General Public License")
 
 set(GMSH_API
+  ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshConfig.h
+  ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshVersion.h
+  Common/GmshAPI.h)
+
+set(GMSH_API_DEPRECATED
   ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshConfig.h
   ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshVersion.h
   Common/Gmsh.h Common/Context.h Common/GmshDefines.h Common/GmshMessage.h
@@ -165,11 +170,6 @@ set(GMSH_API
   contrib/MeshQualityOptimizer/MeshQualityOptimizer.h
   contrib/MathEx/mathex.h)
 
-get_property(IAMCHILD DIRECTORY  PROPERTY PARENT_DIRECTORY)
-if(IAMCHILD)
-  set(GMSH_API ${GMSH_API} PARENT_SCOPE)
-endif(IAMCHILD)
-
 if(${CMAKE_MAJOR_VERSION} GREATER 2)
   string(TIMESTAMP DATE "%Y%m%d")
 else(${CMAKE_MAJOR_VERSION} GREATER 2)
@@ -235,9 +235,9 @@ if(NOT APPLE)
   endif(HAVE_64BIT_SIZE_T)
 endif(NOT APPLE)
 
-if(ENABLE_WRAP_PYTHON AND NOT ENABLE_BUILD_SHARED)
+if(ENABLE_WRAP_PYTHON_DEPRECATED AND NOT ENABLE_BUILD_SHARED)
   set(ENABLE_BUILD_DYNAMIC ON)
-endif(ENABLE_WRAP_PYTHON AND NOT ENABLE_BUILD_SHARED)
+endif(ENABLE_WRAP_PYTHON_DEPRECATED AND NOT ENABLE_BUILD_SHARED)
 
 if(MSVC)
   # remove annoying warning about bool/int cast performance
@@ -1247,7 +1247,7 @@ if(ENABLE_ZIPPER)
   endif(HAVE_LIBZ)
 endif(ENABLE_ZIPPER)
 
-if(ENABLE_WRAP_PYTHON)
+if(ENABLE_WRAP_PYTHON_DEPRECATED)
   find_package(SWIG)
   find_package(PythonLibs)
   find_package(PythonInterp)# ${PYTHONLIBS_VERSION_STRING} EXACT)
@@ -1261,7 +1261,7 @@ if(ENABLE_WRAP_PYTHON)
       mark_as_advanced(CLEAR PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
     endif(SWIG_MAJOR_VERSION EQUAL 1)
   endif(SWIG_FOUND AND PYTHONLIBS_FOUND)
-endif(ENABLE_WRAP_PYTHON)
+endif(ENABLE_WRAP_PYTHON_DEPRECATED)
 
 if(HAVE_PYTHON)
   if(ENABLE_NUMPY)
@@ -1531,7 +1531,7 @@ endif(ENABLE_BUILD_ANDROID)
 
 # shared library target
 if(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC OR
-   ENABLE_WRAP_PYTHON OR ENABLE_WRAP_JAVA)
+   ENABLE_WRAP_PYTHON_DEPRECATED OR ENABLE_WRAP_JAVA_DEPRECATED)
   add_library(shared SHARED ${GMSH_SRC})
   set_target_properties(shared PROPERTIES OUTPUT_NAME Gmsh)
   set_target_properties(shared PROPERTIES
@@ -1546,7 +1546,7 @@ if(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC OR
   endif(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)
   target_link_libraries(shared ${LINK_LIBRARIES})
 endif(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC OR
-      ENABLE_WRAP_PYTHON OR ENABLE_WRAP_JAVA)
+      ENABLE_WRAP_PYTHON_DEPRECATED OR ENABLE_WRAP_JAVA_DEPRECATED)
 
 # binary targets
 if(HAVE_FLTK)
@@ -1660,15 +1660,18 @@ if(WIN32 OR CYGWIN)
     set(GMSH_LIB .)
     set(GMSH_DOC .)
     set(GMSH_MAN .)
+    set(GMSH_INC .)
   else(ENABLE_OS_SPECIFIC_INSTALL)
     include(GNUInstallDirs)
     set(GMSH_BIN ${CMAKE_INSTALL_BINDIR})
     set(GMSH_LIB ${CMAKE_INSTALL_LIBDIR})
     set(GMSH_DOC ${CMAKE_INSTALL_DOCDIR})
     set(GMSH_MAN ${CMAKE_INSTALL_MANDIR}/man1)
+    set(GMSH_INC ${CMAKE_INSTALL_INCLUDEDIR})
   endif(ENABLE_OS_SPECIFIC_INSTALL)
   if(CYGWIN)
     unix2dos(GMSH_API)
+    unix2dos(GMSH_API_DEPREATED)
     unix2dos(WELCOME_FILE)
     unix2dos(LICENSE_FILE)
     unix2dos(CREDITS_FILE)
@@ -1686,12 +1689,14 @@ elseif(APPLE AND ENABLE_OS_SPECIFIC_INSTALL)
   set(GMSH_LIB ../MacOS)
   set(GMSH_DOC ../../..)
   set(GMSH_MAN ../../..)
+  set(GMSH_INC ../MacOS)
 else(WIN32 OR CYGWIN)
   include(GNUInstallDirs)
   set(GMSH_BIN ${CMAKE_INSTALL_BINDIR})
   set(GMSH_LIB ${CMAKE_INSTALL_LIBDIR})
   set(GMSH_DOC ${CMAKE_INSTALL_DOCDIR})
   set(GMSH_MAN ${CMAKE_INSTALL_MANDIR}/man1)
+  set(GMSH_INC ${CMAKE_INSTALL_INCLUDEDIR})
 endif(WIN32 OR CYGWIN)
 
 # mark targets as optional so we can install them separately if needed
@@ -1742,7 +1747,8 @@ if(ENABLE_ONELAB)
   install(FILES ${ONELAB_PY} DESTINATION ${GMSH_BIN})
 endif(ENABLE_ONELAB)
 if(ENABLE_BUILD_LIB OR ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
-  install(FILES ${GMSH_API} DESTINATION include/gmsh)
+  install(FILES ${GMSH_API} DESTINATION ${GMSH_INC})
+  install(FILES ${GMSH_API_DEPRECATED} DESTINATION ${GMSH_INC}/gmsh)
 endif(ENABLE_BUILD_LIB OR ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
 install(FILES ${WELCOME_FILE} DESTINATION ${GMSH_DOC} RENAME README.txt)
 install(FILES ${LICENSE_FILE} DESTINATION ${GMSH_DOC})
@@ -1762,6 +1768,11 @@ add_custom_target(get_headers
   COMMAND ${CMAKE_COMMAND} -E make_directory Headers/gmsh
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 foreach(FILE ${GMSH_API})
+  add_custom_command(TARGET get_headers POST_BUILD COMMAND ${CMAKE_COMMAND}
+    -E copy_if_different ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Headers/
+    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+endforeach(FILE)
+foreach(FILE ${GMSH_API_DEPRECATED})
   add_custom_command(TARGET get_headers POST_BUILD COMMAND ${CMAKE_COMMAND}
     -E copy_if_different ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Headers/gmsh/
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
@@ -1836,6 +1847,11 @@ if(APPLE AND ENABLE_BUILD_LIB)
         ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Gmsh.framework/Headers/
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
   endforeach(FILE)
+  foreach(FILE ${GMSH_API_DEPRECATED})
+    add_custom_command(TARGET framework POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+        ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Gmsh.framework/Headers/
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+  endforeach(FILE)
 endif(APPLE AND ENABLE_BUILD_LIB)
 
 set(CPACK_PACKAGE_VENDOR "Christophe Geuzaine and Jean-Francois Remacle")
@@ -1902,12 +1918,12 @@ if(HAVE_PYTHON)
   add_subdirectory(wrappers/gmshpy)
 endif(HAVE_PYTHON)
 
-if(ENABLE_WRAP_JAVA)
+if(ENABLE_WRAP_JAVA_DEPRECATED)
   if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
     message(WARNING "Java wrapping samples will not work without BLAS and LAPACK")
   endif(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
   add_subdirectory(wrappers/java)
-endif(ENABLE_WRAP_JAVA)
+endif(ENABLE_WRAP_JAVA_DEPRECATED)
 
 include(CPack)
 
diff --git a/Common/GmshAPI.cpp b/Common/GmshAPI.cpp
index 1246a0210ccf31358dcab4a82d86f92ead958767..b3e1585bc068b3b78ab3600a834d9f79d0237d65 100644
--- a/Common/GmshAPI.cpp
+++ b/Common/GmshAPI.cpp
@@ -1,118 +1,117 @@
-/* Gmsh - Copyright (C) 1997-2017 C. Geuzaine, J.-F. Remacle
- *
- * See the LICENSE.txt file for license information. Please report all
- * bugs and problems to the public mailing list <gmsh@onelab.info>.
- */
-
-/*
-  This is the embryo of what will become the Gmsh API.
-
-  Don't use it, it's not ready :-) We plan to release a first version in Gmsh
-  3.1, and something more complete in Gmsh 4.0.
-
-  Your input is welcome: please contribute your ideas on
-  http://gitlab.onelab.info/gmsh/gmsh/issues/188
- */
+// Gmsh - Copyright (C) 1997-2017 C. Geuzaine, J.-F. Remacle
+//
+// See the LICENSE.txt file for license information. Please report all
+// bugs and problems to the public mailing list <gmsh@onelab.info>.
 
 #include "Gmsh.h"
+#include "GmshAPI.h"
+#include "GModel.h"
+#include "GModelIO_GEO.h"
+#include "GModelIO_OCC.h"
 
-extern "C"
-{
-  /* Gmsh */
-  int gmshInitialize(int argc, char **argv)
-  {
-    return !GmshInitialize(argc, argv);
-  }
-
-  int gmshFinalize()
-  {
-    return !GmshFinalize();
-  }
-
-  int gmshOpen(const char *fileName)
-  {
-    return !GmshOpenProject(fileName);
-  }
-
-  int gmshMerge(const char *fileName)
-  {
-    return !GmshMergeFile(fileName);
-  }
+// Gmsh
 
-  int gmshExport(const char *fileName)
-  {
-    return 1;
-  }
+int gmshInitialize(int argc, char **argv)
+{
+  return !GmshInitialize(argc, argv);
+}
 
-  int gmshClear()
-  {
-    return 1;
-  }
+int gmshFinalize()
+{
+  return !GmshFinalize();
+}
 
-  /* Gmsh Options */
-  int gmshOptionsSetNumber(const char *name, double value)
-  {
-    return 1;
-  }
+int gmshOpen(const std::string &fileName)
+{
+  return !GmshOpenProject(fileName);
+}
 
-  int gmshOptionsGetNumber(const char *name, double *value)
-  {
-    return 1;
-  }
+int gmshMerge(const std::string &fileName)
+{
+  return !GmshMergeFile(fileName);
+}
 
-  /* Gmsh Model */
-  int gmshModelCreate(const char *name)
-  {
-    return 1;
-  }
+int gmshExport(const std::string &fileName)
+{
+  return !GmshWriteFile(fileName);
+}
 
-  int gmshModelSetCurrent(const char *name)
-  {
-    return 1;
-  }
+int gmshClear()
+{
+  return !GmshClearProject();
+}
 
-  int gmshModelDestroy()
-  {
-    return 1;
-  }
+// GmshOption
 
-  int gmshModelMesh(int dim)
-  {
-    return 1;
-  }
+static void splitOptionName(const std::string &fullName, std::string &category,
+                            std::string &name, int &index)
+{
+  std::string::size_type d = fullName.find_first_of('.');
+  category = fullName.substr(0, d);
+  std::string::size_type b1 = fullName.find_first_of('[');
+  std::string::size_type b2 = fullName.find_last_of(']');
+  if(b1 != std::string::npos && b2 != std::string::npos){
+    std::string id = fullName.substr(b1, b2 - b1);
+    name = fullName.substr(d, b1 - d);
+  }
+  else{
+    index = 0;
+    name = fullName.substr(d);
+  }
+  Msg::Debug("Decoded option name '%s' . '%s' '[%d]'", category.c_str(),
+             name.c_str(), index);
+}
 
-  int gmshModelAddEmbeddedVertex(int tag, int inDim, int inTag)
-  {
-    return 1;
-  }
+int gmshOptionSetNumber(const std::string &name, double value)
+{
+  std::string c, n;
+  int i;
+  splitOptionName(name, c, n, i);
+  return !GmshSetOption(c, n, value, i);
+}
 
-  /* Gmsh Model Geo Internals */
+int gmshOptionGetNumber(const std::string &name, double &value)
+{
+  std::string c, n;
+  int i;
+  splitOptionName(name, c, n, i);
+  return !GmshGetOption(c, n, value, i);
+}
 
-  int gmshModelGeoAddPoint(int *tag, double x, double y, double z, double lc)
-  {
-    return 1;
-  }
+int gmshOptionSetString(const std::string &name, const std::string &value)
+{
+  std::string c, n;
+  int i;
+  splitOptionName(name, c, n, i);
+  return !GmshSetOption(c, n, value, i);
+}
 
-  int gmshModelGeoAddLine(int *tag, int startVertexTag, int endVertexTag)
-  {
-    return 1;
-  }
+int gmshOptionGetString(const std::string &name, std::string &value)
+{
+  std::string c, n;
+  int i;
+  splitOptionName(name, c, n, i);
+  return !GmshGetOption(c, n, value, i);
+}
 
-  int gmshModelGeoSynchronize()
-  {
-    return 1;
-  }
+// GmshModel
 
-  /* Gmsh Model OCC Internals */
+int gmshModelCreate(const std::string &name)
+{
+  return 0;
+}
 
-  int gmshModelOCCAddPoint(int *tag, double x, double y, double z, double lc)
-  {
-    return 1;
-  }
+int gmshModelSetCurrent(const std::string &name)
+{
+  return 0;
+}
 
-  int gmshModelOCCSynchronize()
-  {
-    return 1;
-  }
+int gmshModelDestroy()
+{
+  return 0;
+}
 
+int gmshModelMesh(int dim)
+{
+  return 0;
 }
diff --git a/Common/GmshAPI.h b/Common/GmshAPI.h
index 652560261261bd97154b64b642b843d91d64b52f..2e471a094d2325820936b2120ab62b13cf82d532 100644
--- a/Common/GmshAPI.h
+++ b/Common/GmshAPI.h
@@ -1,21 +1,26 @@
-/* Gmsh - Copyright (C) 1997-2017 C. Geuzaine, J.-F. Remacle
- *
- * See the LICENSE.txt file for license information. Please report all
- * bugs and problems to the public mailing list <gmsh@onelab.info>.
- */
+// Gmsh - Copyright (C) 1997-2017 C. Geuzaine, J.-F. Remacle
+//
+// See the LICENSE.txt file for license information. Please report all
+// bugs and problems to the public mailing list <gmsh@onelab.info>.
 
-/*
-  This is the embryo of what will become the Gmsh API.
+#ifndef _GMSH_API_H_
+#define _GMSH_API_H_
 
-  Don't use it, it's not ready :-) We plan to release a first version in Gmsh
-  3.1, and something more complete in Gmsh 4.0.
+// This is the embryo of what will become the Gmsh API.
+//
+// Don't use it yet, it's not ready :-) We plan to release a first version in
+// Gmsh 3.1, and something more complete in Gmsh 4.0.
+//
+// Your input is welcome: please contribute your ideas on
+// https://gitlab.onelab.info/gmsh/gmsh/issues/188
+//
+// By design, the API is purely functional, and only uses elementary C++ types
+// from the standard library. This design should not and will not change.
 
-  Your input is welcome: please contribute your ideas on
-  http://gitlab.onelab.info/gmsh/gmsh/issues/188
- */
+// All functions return 0 on successful completion.
 
-#ifndef _GMSH_API_H_
-#define _GMSH_API_H_
+#include <vector>
+#include <string>
 
 #if defined(WIN32)
 #define GMSH_API __declspec(dllexport) int
@@ -23,48 +28,119 @@
 #define GMSH_API int
 #endif
 
-typedef struct gmshEntity{ int dim, tag; };
-typedef struct gmshIntVector{ int n; int *v; };
-typedef struct gmshDoubleVector{ int n; double *v; };
-typedef struct gmshEntityVector{ int n; gmshEntity *v; };
+// Gmsh
+GMSH_API gmshInitialize(int argc, char **argv);
+GMSH_API gmshFinalize();
+GMSH_API gmshOpen(const std::string &fileName);
+GMSH_API gmshMerge(const std::string &fileName);
+GMSH_API gmshExport(const std::string &fileName);
+GMSH_API gmshClear();
+
+// GmshOption
+GMSH_API gmshOptionSetNumber(const std::string &name, double value);
+GMSH_API gmshOptionGetNumber(const std::string &name, double &value);
+GMSH_API gmshOptionSetString(const std::string &name, const std::string &value);
+GMSH_API gmshOptionGetString(const std::string &name, std::string &value);
 
-/* all functions return 0 on successful completion */
+// GmshModel
+GMSH_API gmshModelCreate(const std::string &name);
+GMSH_API gmshModelSetCurrent(const std::string &name);
+GMSH_API gmshModelDestroy();
+GMSH_API gmshModelMesh(int dim);
+GMSH_API gmshModelGetElementaryTags(int dim, std::vector<int> &tags);
+GMSH_API gmshModelGetPhysicalTags(int dim, std::vector<int> &tags);
+GMSH_API gmshModelSetPhysicalGroup(int dim, int tag, const std::vector<int> &tags);
+GMSH_API gmshModelGetPhysicalGroup(int dim, int tag, std::vector<int> &tags);
+GMSH_API gmshModelSetPhysicalName(int dim, int tag, const std::string &name);
+GMSH_API gmshModelGetPhysicalName(int dim, int tag, std::string &name);
+GMSH_API gmshModelGetVertexCoordinates(int tag, double &x, std::vector<double> &coord);
+GMSH_API gmshModelGetMeshVertices(int dim, int tag, std::vector<int> &vertexTags,
+                                  std::vector<double> &coords,
+                                  std::vector<double> &parametricCoords);
+GMSH_API gmshModelGetMeshElements(int dim, int tag, std::vector<int> &types,
+                                  std::vector<std::vector<int> > &elementTags,
+                                  std::vector<std::vector<int> > &vertexTags);
+GMSH_API gmshModelGetBoundaryTags(const std::vector<std::pair<int, int> > &inDimTags,
+                                  std::vector<std::pair<int, int> > &outDimTags,
+                                  bool combined, bool oriented, bool recursive);
+GMSH_API gmshModelSetMeshSize(int dim, int tag, double size);
+GMSH_API gmshModelSetCompoundMesh(int dim, const std::vector<int> &tags);
+GMSH_API gmshModelSetTransfiniteLine(int tag, int nPoints, int type, double coef);
+GMSH_API gmshModelSetTransfiniteSurface(int tag, int arrangement,
+                                        const std::vector<int> &cornerTags);
+GMSH_API gmshModelSetTransfiniteVolume(int tag, const std::vector<int> &cornerTags);
+GMSH_API gmshModelSetRecombine(int dim, int tag, double angle);
+GMSH_API gmshModelSetSmoothing(int tag, int val);
+GMSH_API gmshModelSetReverseMesh(int dim, int tag);
+GMSH_API gmshModelAddEmbeddedVertex(int tag, int inDim, int inTag);
 
-extern "C"
-{
-  /* Gmsh */
-  GMSH_API gmshInitialize(int argc, char **argv);
-  GMSH_API gmshFinalize();
-  GMSH_API gmshOpen(const char *fileName);
-  GMSH_API gmshMerge(const char *fileName);
-  GMSH_API gmshExport(const char *fileName);
-  GMSH_API gmshClear();
+// GmshModelGeo
+GMSH_API gmshModelGeoAddVertex(int &tag, double x, double y, double z, double lc);
+GMSH_API gmshModelGeoAddLine(int &tag, int startTag, int endTag);
+GMSH_API gmshModelGeoAddCircleArc(int &tag, int startTag, int centerTag, int EndTag,
+                                  double nx=0., double ny=0., double nz=0.);
+GMSH_API gmshModelGeoAddEllipseArc(int &tag, int startTag, int centerTag, int majorTag,
+                                   int endTag, double nx=0., double ny=0., double nz=0.);
+GMSH_API gmshModelGeoAddSpline(int &tag, const std::vector<int> &vertexTags);
+GMSH_API gmshModelGeoAddBSpline(int &tag, const std::vector<int> &vertexTags);
+GMSH_API gmshModelGeoAddBezier(int &tag, const std::vector<int> &vertexTags);
+GMSH_API gmshModelGeoAddNurbs(int &tag, const std::vector<int> &vertexTags,
+                              const std::vector<double> &knots);
+GMSH_API gmshModelGeoAddLineLoop(int &tag, const std::vector<int> &edgeTags);
+GMSH_API gmshModelGeoAddPlaneSurface(int &tag, const std::vector<int> &wireTags);
+GMSH_API gmshModelGeoAddDiscreteSurface(int &tag);
+GMSH_API gmshModelGeoAddSurfaceFilling(int &tag, const std::vector<int> &wireTags,
+                                       int sphereCenterTag=-1);
+GMSH_API gmshModelGeoAddSurfaceLoop(int &tag, const std::vector<int> &faceTags);
+GMSH_API gmshModelGeoAddVolume(int &tag, const std::vector<int> &shellTags);
+GMSH_API gmshModelGeoExtrude(const std::vector<std::pair<int, int> > &inDimTags,
+                             double dx, double dy, double dz,
+                             std::vector<std::pair<int, int> > &outDimTags,
+                             const std::vector<int> &numElements,
+                             const std::vector<double> &heights, bool recombine);
+GMSH_API gmshModelGeoRevolve(const std::vector<std::pair<int, int> > &inDimTags,
+                             double x, double y, double z,
+                             double ax, double ay, double az, double angle,
+                             std::vector<std::pair<int, int> > &outDimTags,
+                             const std::vector<int> &numElements,
+                             const std::vector<double> &heights, bool recombine);
+GMSH_API gmshModelGeoTwist(const std::vector<std::pair<int, int> > &inDimTags,
+                           double x, double y, double z,
+                           double dx, double dy, double dz,
+                           double ax, double ay, double az, double angle,
+                           std::vector<std::pair<int, int> > &outDimTags,
+                           const std::vector<int> &numElements,
+                           const std::vector<double> &heights, bool recombine);
+GMSH_API gmshModelGeoTranslate(const std::vector<std::pair<int, int> > &dimTags,
+                               double dx, double dy, double dz);
+GMSH_API gmshModelGeoRotate(const std::vector<std::pair<int, int> > &dimTags,
+                            double x, double y, double z, double ax, double ay, double az,
+                            double angle);
+GMSH_API gmshModelGeoDilate(const std::vector<std::pair<int, int> > &dimTags,
+                            double x, double y, double z,
+                            double a, double b, double c);
+GMSH_API gmshModelGeoSymmetry(const std::vector<std::pair<int, int> > &dimTags,
+                              double a, double b, double c, double d);
+GMSH_API gmshModelGeoCopy(const std::vector<std::pair<int, int> > &inDimTags,
+                          std::vector<std::pair<int, int> > &outDimTags);
+GMSH_API gmshModelGeoRemove(const std::vector<std::pair<int, int> > &dimTags,
+                            bool recursive=false);
+GMSH_API gmshModelGeoRemoveAllDuplicates();
+GMSH_API gmshModelGeoSynchronize();
 
-  /* Gmsh Options */
-  GMSH_API gmshOptionsSetNumber(const char *name, double value);
-  GMSH_API gmshOptionsGetNumber(const char *name, double *value);
+// GmshModelOCC
+GMSH_API gmshModelOCCAddVertex(int &tag, double x, double y, double z, double lc);
+GMSH_API gmshModelOCCAddLine(int &tag, int startVertexTag, int endVertexTag);
+GMSH_API gmshModelOCCExtrude(const std::vector<std::pair<int, int> > &inDimTag,
+                             double dx, double dy, double dz,
+                             std::vector<std::pair<int, int> > &outDimTags);
+GMSH_API gmshModelOCCRemoveAllDuplicates();
+GMSH_API gmshModelOCCSynchronize();
 
-  /* Gmsh Model */
-  GMSH_API gmshModelCreate(const char *name);
-  GMSH_API gmshModelSetCurrent(const char *name);
-  GMSH_API gmshModelDestroy();
-  GMSH_API gmshModelMesh(int dim);
-  GMSH_API gmshModelAddEmbeddedVertex(int tag, int inDim, int inTag);
+// GmshSolver
 
-  /* Gmsh Model Geo Internals */
-  GMSH_API gmshModelGeoAddVertex(int *tag, double x, double y, double z, double lc);
-  GMSH_API gmshModelGeoAddLine(int *tag, int startVertexTag, int endVertexTag);
-  GMSH_API gmshModelGeoAddPolyLine(int *tag, const gmshIntVector *vertexTags);
-  GMSH_API gmshModelGeoExtrude(const gmshEntityVector *in, double dx, double dy,
-                               double dz, gmshEntityVector *out);
-  GMSH_API gmshModelGeoSynchronize();
+// GmshPost
 
-  /* Gmsh Model OCC Internals */
-  GMSH_API gmshModelOCCAddVertex(int *tag, double x, double y, double z, double lc);
-  GMSH_API gmshModelOCCAddLine(int *tag, int startVertexTag, int endVertexTag);
-  GMSH_API gmshModelOCCExtrude(const gmshEntityVector *in, double dx, double dy,
-                               double dz, gmshEntityVector *out);
-  GMSH_API gmshModelOCCSynchronize();
-}
+// GmshPlugin
 
 #endif
diff --git a/Geo/GEdge.h b/Geo/GEdge.h
index f3992b9be0947e1f878fd677a5f17c65a9542bfb..4538a95d80af0914523a647c87a428ddee9e7eec 100644
--- a/Geo/GEdge.h
+++ b/Geo/GEdge.h
@@ -86,7 +86,7 @@ class GEdge : public GEntity {
   // get the oriented bounding box
   virtual SOrientedBoundingBox getOBB();
 
-  // regions that are boundedby this entity
+  // regions that are bounded by this entity
   virtual std::list<GRegion*> regions() const;
 
   // faces that this entity bounds
diff --git a/doc/texinfo/opt_general.texi b/doc/texinfo/opt_general.texi
index afcbcf25da5b4c0fdc8cbce6640c18428aa64360..74a12a3b5f83ab368e62553de569b2e4b722cd00 100644
--- a/doc/texinfo/opt_general.texi
+++ b/doc/texinfo/opt_general.texi
@@ -39,6 +39,11 @@ Background image file in JPEG, PNG or PDF format@*
 Default value: @code{""}@*
 Saved in: @code{General.OptionsFileName}
 
+@item General.BuildOptions
+Gmsh build options (read-only)@*
+Default value: @code{" 64Bit Ann Bamg Bfgs Blas(VecLib) Blossom C++11 Chaco DIntegration Dlopen Fltk GMP Gmm Jpeg(Fltk) Kbipack Lapack(VecLib) MathEx Mesh Metis Mmg3d Mpeg NativeFileChooser Netgen ONELAB ONELABMetamodel OpenCASCADE OpenGL OptHom PETSc Parser Plugins Png(Fltk) Post SLEPc Solver Taucs TetGen/BR Tetgen1.5 Voro3D Zlib"}@*
+Saved in: @code{-}
+
 @item General.DefaultFileName
 Default project file name@*
 Default value: @code{"untitled.geo"}@*
@@ -154,6 +159,11 @@ Temporary file used by the geometry module@*
 Default value: @code{".gmsh-tmp"}@*
 Saved in: @code{General.SessionFileName}
 
+@item General.Version
+Gmsh version (read-only)@*
+Default value: @code{"3.0.7"}@*
+Saved in: @code{-}
+
 @item General.WatchFilePattern
 Pattern of files to merge as they become available@*
 Default value: @code{""}@*
diff --git a/doc/texinfo/opt_plugin.texi b/doc/texinfo/opt_plugin.texi
index 0702e457f57705a330bcf0d8ec0c0d27b9eea05b..ba1781bbf9996a95857fdb954d8c594c14a60bf8 100644
--- a/doc/texinfo/opt_plugin.texi
+++ b/doc/texinfo/opt_plugin.texi
@@ -366,14 +366,6 @@ Numeric options:
 Default value: @code{-1}
 @end table
 
-@item Plugin(DuplicateBoundaries)
-Plugin(DuplicateBoundaries) is not documented yet.
-Numeric options:
-@table @code
-@item Dummy
-Default value: @code{1}
-@end table
-
 @item Plugin(Eigenvalues)
 Plugin(Eigenvalues) computes the three real eigenvalues of each tensor in the view `View'.@*
 @*
@@ -443,9 +435,7 @@ Plugin(FaultZone) convert all the embedded lines of an existing surfacic mesh to
 @*
 `Thickness' is the thickness of the flat quadrangles. Set a value different to zero can be helpful to check the connectivity. @*
 @*
-`Prefix' is the prefix of the name of physicals containing the new embedded.
-All physicals containing embedded lines are replaced by physicals containing
-the corresponding joint elements.
+`Prefix' is the prefix of the name of physicals containing the new embedded. All physicals containing embedded lines are replaced by physicals containing the corresponding joint elements.
 String options:
 @table @code
 @item Prefix
diff --git a/utils/api_demos/mainSimple.cpp b/utils/api_demos/mainSimple.cpp
index 34d02104c4359b2ea71dcb698f8ea41be79eb4eb..a33724f2b61aa948fa753c935a366f46d9e6eecb 100644
--- a/utils/api_demos/mainSimple.cpp
+++ b/utils/api_demos/mainSimple.cpp
@@ -1,12 +1,10 @@
 #include <stdio.h>
-#include "Gmsh.h"
-#include "GModel.h"
-#include "MElement.h"
+#include "GmshAPI.h"
 
 int main(int argc, char **argv)
 {
-  GmshInitialize(argc, argv);
-  GmshSetOption("Mesh", "Algorithm", 5.);
+  gmshInitialize(argc, argv);
+  gmshSetOption("Mesh", "Algorithm", 5.);
   GModel *m = new GModel();
   m->readGEO("../../tutorial/t5.geo");
   //GmshMergeFile("../../tutorial/t5.geo"); // will also set the bbox