Bistable dynamics in microbial ecology and systems biology