Tidied up test. Ensured lists are different before testing for order\nAdd flag to ensure sorting only occurs when the list of declarations has changed.
Updated definitions to use Expression objects instead of strings
Fixed node code generator