Re-factored "CompileCustomNodeDefinition"

Background
-----
This pull request does not add/remove/change any functionality, it refactored ```CompileCustomNodeDefinition``` method, change it from taking ```List<AssociativeNode>``` to taking ```IEnumerable<AssociativeNode>```. As a result of changing that, ```GenerateGraphSyncDataForCustomNode``` is also updated.

This pull request represents minor code restructuring that is required by [a larger change](https://github.com/Benglin/Dynamo/compare/Concurrent) in ```Concurrent branch```. It is meant to break code changes down into smaller pieces.

Unit Testing
-----
I ran the following test cases that heavily rely on these methods, and there is no regression:

```
- Dynamo.Tests.CustomNodeEvaluationViewModel
- Dynamo.Tests.CustomNodes
```

Hi @ke-yu, @Randy-Ma and @aparajit-pratap, whoever gets to this and review first gets to merge this PR, how's that for a prize?
It appears that you use Count() twice, and ElementAt() once as well. Each of these methods will require iterating the IEnumerable, which in inefficient. If this method *needs* to accept an IEnumerable, then you should at least call ToList() to cache the enumeration, and then operate on that list instead.