Starting/stopping a virtual beacon added.
Disconnect moved to a separate thread.
Input validation.
Clean up in JS file.