Added countLeaves(), countLevels(), and sum()
Added tests for countLeaves(), countLevels(), and sum()