Introduce Headers class, fix tests