Refactor js docs jade file (no spaghetti)