schema compile REFACTOR implement flag meaning changed

Implemented set to 1 means that it was already tried
implementing the module. That means that all tasks
executing only once for each implemented module
are done and should never be performed again. Also,
these one-time tasks were isolated and moved to
lys_implement() so that lys_compile() performs
only strict compiled module creation that cannot
require recompilation on its own.
diff --git a/src/schema_compile.h b/src/schema_compile.h
index 3206b39..aba8094 100644
--- a/src/schema_compile.h
+++ b/src/schema_compile.h
@@ -276,16 +276,31 @@
 LY_ERR lys_recompile(struct ly_ctx *ctx, ly_bool log);
 
 /**
- * @brief Compile printable schema into a validated schema linking all the references.
+ * @brief Compile schema into a validated schema linking all the references.
+ *
+ * Implemented flag of @p mod must be set meaning this function should be called only if the module
+ * is being recompiled, otherwise call ::lys_implement().
  *
  * @param[in] mod Pointer to the schema structure holding pointers to both schema structure types. The ::lys_module#parsed
  * member is used as input and ::lys_module#compiled is used to hold the result of the compilation.
  * @param[in] options Various options to modify compiler behavior, see [compile flags](@ref scflags).
- * @param[in] recompile Whether @p mod is compiled for the first time or only recompiled.
- * @param[in,out] unres Global unres structure for newly implemented modules. If `recompile` was set, @p mod
- * was actually not compiled because there is at least one compiled imported module that must be recompiled first.
- * @return LY_ERR value - LY_SUCCESS or LY_EVALID.
+ * @param[in,out] unres Global unres structure to add to.
+ * @return LY_SUCCESS on success.
+ * @return LY_ERR on error.
  */
-LY_ERR lys_compile(struct lys_module *mod, uint32_t options, ly_bool recompile, struct lys_glob_unres *unres);
+LY_ERR lys_compile(struct lys_module *mod, uint32_t options, struct lys_glob_unres *unres);
+
+/**
+ * @brief Implement a single module, can be called recursively.
+ *
+ * @param[in] mod Module to implement.
+ * @param[in] features Features to set, see ::lys_set_features().
+ * @param[in,out] unres Global unres to add to.
+ * @return LY_SUCCESS on success.
+ * @return LY_ERECOMPILE on required recompilation, @p mod implemented flag is kept and
+ * is left in @p unres implementing set so that it is known that the next compilation is recompilation.
+ * @return LY_ERR on error.
+ */
+LY_ERR lys_implement(struct lys_module *mod, const char **features, struct lys_glob_unres *unres);
 
 #endif /* LY_SCHEMA_COMPILE_H_ */