Small js library for calculating payments toward a principal