Devices2

How about merging this into master, to close #114 and #122?