Pythonization of some code files

This commit should NOT be merged into sugarlabs:master, as this should be
rebased into a more sensable overall commit scheme for the whole pull request.