Data storage and processing using magnetic nanowires