Merge pull request #2 from gfokkema/device_rewrite

Device rewrite
Merge master into alignment_debug