doc: refactored api documentation using linux man
c: implemented synchronous variants
c: better error reporting using ErrnoException
c: cleanup
js: argument handling moved to javascript