Tidied up code related to lockfiles, and ensure that ID of hubs is truly unique (don't rely on thread count).
Isolate code related to file locking
Distinguish between lockfile itself and custom lockfile name
Use cross-platform user home directory, and move code to find main hub into lockfile_helpers