rearrange library load and tests.