Most of the changes were taking this kind of file `X.py`, and moving the functions into one of 3 files: `devices/X.py`, `engine/X.py`, or `users/X.py`, based on the definitions in #500 and in this pull request.  That separation was actually very easy.

All the original files look like deletions, then additions of imports.