Add info on build dependencies.
Change pid and dat file locations from /var to /run.
Fix writing to sd card every second.