added test and comments. Also moved some methods to ReverseStringBuffer