Nutscan fix and enhancement (by Vaclav Krpec)

Added support for serialisation of device types (string).
Fixed bug in device options list handling.
Added device disconnect routine for graceful connection closing.