fix up missing semicolon
as per feedback - move code from common.js, make media.js use a history.js function, fix breaking news JS error, restructure exposed API of history.js