added grunt config and improved javascript