refactored codes and tests to be modular, refactored BSTs to be prototypes