reorganized asset loading, changed some APIs