Big update to modernize and rearrange the bundle code.