Tuning the Surface Functionality of Fe3O4 for Sensitive and Selective Detection of Heavy Metal Ions