Updated to be more modular and includable