Move classes to appropriate packages.
Optimize imports.
Implement TreeNode with DFS, BFS, and spec.