added node seeking, fixed comparison functions

Added AVL tree node functions for retrieving the previous and next nodes.
Fixed comparison functions for integers and pointers which was previously
flipped.