Detector refactor

Beats now stored in dedicated collections, detection code more
streamlined