lib: refactor `Configuration` (huge commit)

In preparation for the client-server mode, this patch reorganizes the
configuration:
There are now 3 modes, Standalone (a.k.a. classic), Client, and Server.
Many parts are not implemented but this is the first version that
make everything compile.
build: build test plugins every time
lib: rename `State` → `Engine`
lib: homogenize the API of the `Engine` module
test,build: change `test-env` to “Standalone” mode