Started a more thorough documentation.

* started adding doxygen comments
* added safe.h: implements malloc that dies when out of memory.
* some style fixes
* started adding support for freefem
Finished adding comments.

* now everything uses doxygen
* everything uses xmalloc and whatnot.