Bugfixes and shelled out alarms and REST server

* Many bugfixes: setting the alarms,
  feedTime vs. am_min, NTP sync, ...)
* Worked out order of operations so REST writes don't break
  variables.