doc: Document most of the library using doxygen

Signed-off-by: Andrew 'Necromant' Andrianov <andrew@ncrmnt.org>