Companies like Facebook and Google are loading their workspaces with perks, convenience and fun to attract and keep the best.