Refactor rootnstocjs, clean up documentation etc.