Improved HUD performance and added an API for the HUD.