The classification of defective threefolds