Cleaned up device_tracker and added tests