Replace classes with functions.

This snapshot may be broken since refactoring carried out under
GNU/Linux.