Improves jsdoc generator

Produces already quite an usable documentation, but the
code is really just hacked together.