A theory of many-body localization in periodically driven systems