This package ensures that only referenced packages are loaded. 2 is referenced by this example and 1 is referenced by 2. 3 and 4 are loaded, but as they aren't used by the page right away, they aren't loaded at the start.
Source files:
Click this button to run a script that requires package 4: