Convert tests to common.js.

This is not working yet as I do not know what to change in gruntfile.