Underlying code for multiple alarms. Initial unit tests. Fix & cleanup.