Text this: Microgrid Reliability Modeling and Optimal Planning of Battery Energy Storage Systems