Source re-org: add a file registration.c.
Build system: improve usage of cmake.