Implemented root() function.
Added getter for the cursor and replaced all calls to this.cur.