Feed upstream/lib improvements

Some small improvements to module code, does not affect behaviour (except deprecating types.list favoring types.listOf), see nixos patch