Fix device ownership, improve scripts.
Merge branch 'dev' of https://github.com/browndav/medic-os into dev