build_osx: fix path
moved tests to subdirectory
moved demos to subdirectory
src/tempo/beattracking.c: avoid casting, make sure b is well behaved

  Many thanks to Olivier Robert for his patch, and sorry for the delay!