Turned documentation into markdown format

...for compatability with dokx. The dotfile is not strictly
necessary but is useful in excluding test code etc. from generated docs.

I changed the comment style to simplify parsing.