refactored the contacts javascript handlers and cleaned up the front-end styles.