Added documentation

Some docs still need completion, and are marked with TODO. Please do so
if you see them.