Added alias/import caching. Fixed bug so they're returned in the correct order.