Update module interface

The way of the future is to use 'imports' instead of 'require', and take
'lib' as direct input instead of getting it from 'pkgs.lib'.