modularized code added a new contacts schema

Code was living in server.js entirely fixed this by modularizing code. Also added contacts schema.