Fix module initialisation, add API doc for s*alloc

Also be more consequent about the order of type specifiers. The policy
is:
	[type] [size] [sign] [meta]

For instance we've got
	int long unsigned const

This doesn't look very intuitive, but it's a lot more logical. In case I
need `register`, I'll still have to figure out where to put it; maybe
it'd go after [meta].

As for module initialisation, since `term` is called also after a failed
`init`, we need to be careful when to set the function pointer.

FOR MODULE DEVELOPERS

* `term` has `void` as a return type now.
* It is recommended to perform the assignment at the end of `init`, in
  order to be sure that `term` doesn't attempt to clean up stuff that it
  mustn't in case `init` fails.
* Make use of the `s*alloc` functions. It saves lines of code and maybe
  even an #include <stdlib.h>