Optimal Electrification Planning Incorporating On- and Off-Grid Technologies: The Reference Electrification Model (REM)