Cleanup and rewrite of assetlibrary class