Using FileOnDevice constructor function

This allow for overriding toString on all file objects. Using {} and
trying to overload {}.constructor.prototype.toString -> was wrong and
led to a problem in websocket address parsing
(Object.prototype.toString.call(address) == '[object Array]' failed due
to overriding directly)