Replace moon phase calculation code
The Berkeley code had an overflow issue, and its license contained an advertising clause. Replace it with code adapted from the public-domain Moontool.
Since the API of this adapted code gives the phase angle directly, this also allows to simplify the calculation of the moon phase for a given date.