Ground-state cooling of a mechanical oscillator and detection of a weak force using a Bose-Einstein condensate