Cleanup some of the old codes

Note, this needs more work on the usb-moded side at least before it can be merged.