split out grid code into a directive
added missing template file