Code Refactoring

Breaking out methods for getting the tone id and playing the tone. Also,
refactored the binary to tone id algorithm.