Added event machine compatibility by adding use_em option to opts.