Moved JS validation into Dojo module