I mean an isolated unit that could be ripped out at any time and would be immediately useful on its own.
Anyway, abecedarius (below) has phrased it better than I could.
Also, a library can be thought of as a collection of modules.