Factor out verify_storage.h
Factor out verify_exec.h
Introduce SyntaxCheck, PromiseKept and Repair for verify_exec

This is a proof of concept for splitting the traditional Verify function
for modules. It splits Verify into 3 stages, syntax checking (evaluation stage),
status checking (whether the promise needs repair), and Repair. Repair returns an
ActionResult, specifying the outcome of attempting to repair the promise.

The end goal is to have all modules take a struct with callbacks to these functions,
enabling pluginification and a step towards introducing isolated evaluation state
(by effectively removing cfPS from lower levels).

Additionally, a GetLockName function is needed for each promise type, but this
may be reconsidered in the future (when we get around to reconsider locking).
Merge pull request #296 from sigurdteigen/cleanup/split-verify

Introduce SyntaxCheck, PromiseKept and Repair for verify_exec
et rid of MINGW, use __MINGW32__ instead (Redmine #2018)
Buffer style fixes
Factor out verify_databases.h
Factor out verify_services.h
Factor out verify_methods.h
Remove duplicate function. FileStateToChar is defined and used in files_lib.c
Kill global VINPUTFILE, with fire

Leaving global MINUSF intact for now, may need to be wrapped up in some
context object.
Merge pull request #298 from sigurdteigen/cleanup/remove-vinputfile

Kill global VINPUTFILE, with fire
add canonify() to some handle promises to prevent cf-promises FATAL error about invalid rvalue
Buffer memory strategy

Rewrote the whole memory allocation strategy for buffer.
Now data is preserved even in case of failures.
Printf now returns 0 to signal that a retry is needed.
Memory is allocated as it is needed, not by increments.
RefCount memory allocation

Forgot to check one memory allocation when attaching ref_counts.
Memory cap for buffer

Each buffer instance has a memory cap, thus avoiding using all the memory in
one go.
Boundary condition fix

If the size was exactly BUFFER_SIZE, then we were susceptible of
suffering a buffer overrun. This commit fixes that and introduces
unit tests to make sure this never happens.