Fix and clean up the declaration of global constants

- Move the dead code in config/application.rb to
  config/initializers/constants.rb. They have no effect in the former
  place.

- Remove unnecessary (duplicate) constant declarations in
  config/environments/{development,production}.rb.

- Get SERVER_PID from the standard Rails PID file instead. This is much
  more robust than assuming that the first puma process is what we want.

More importantly, this fixes the 'test' environment which we want to use
in the near future for running tests.