Move at_exit handler into boot.rb