fix deprecated -j for coffee-script

1. add nested querify for rest factory
2. add nested template structure
3. add states
4. List nolonger clean node at beginning.