Initial documentation (#1)

Added docstrings to all functions. Possibly could be better,
but it will do for now.