Added an explicit close() method to KeyHandler.
Added __enter__/__exit__ methods to KeyHandler so it can be used in a with statement.
Updated the compute-account-value.py script to use KeyHandler as a context manager.