First part of doxygen code documentation

see issue #47

main.c and prefs.c to go. Does any1 want to take that over?