Added trigger function to limit number of messages kept per URL
Fixed mistake in testing of index.js, split testing into 2 files.