Improve error message for 'require'.

Now it shows when the package is not installed.

Also fix tests that weren't actually using packages correctly.