Migrate to require.library structure.
Initial work on fixing tests after recent refactoring.