Cleaned up code a bit, added comments, added new code to prevent duplicates from being added to a DeviceContainer, and changed Device.wrapper to be added in at DeviceContainer instead of Device. $(device) now returns the span, not the wrapper.