imported new Loop.cpp using select() from
testing branch so ppl can use it on ubuntu 14.04
Merge branch 'master' into testing