A bunch of code cleanup courtesy of JSHint
Adding Headers option