Require GadgetJs or GadgetCss pages to end in either .js or .css

And add tests!

Change-Id: I7a8bc3cbe96b5c439febe4911cd512ad2870dee2
Merge "Require GadgetJs or GadgetCss pages to end in either .js or .css" into RL2