Modules and clients inherit from a superclass

This will allow us to get rid of some statements/calls repeated in all
modules/clients and also fix #10.