Added some ifdefs and a definition for cmake so that BEM code is not compiled if BEM is not enabled.  Fixes #25.