Convert add-* admin commands to JavaScript.
Properly respond to SIGINT and SIGTERM.