updated router.js

adding routes now can be done using parameter substition, support for
require.js as well as being used as a self-executing anonymous function