binary tree impl with tests