Clean up server.js and add heap dump handler using the heapdump module

Change-Id: I2f81b2471d5adc599e1e37b5bcd19bfb2bb3d1d5
Merge "Clean up server.js and add heap dump handler using the heapdump module"