Refactor and update the build-ctags function to work in Yosemite.