added Apache license to all files
Updated license file to reference when.js