Added rotate_right and rotate_left functions, and unit tests to use them. Also inline-d functions and made swap use swap_basic for neatness