Fixes to header.js, complete unit tests of header module.