Abstracted out the binary branching behavior into its own behavior class and refactored the back end to make it cleaner
cleaned up comments