Graph optimizations

- Move some graph related function as part of MetrilyxGraph object to enable the possibility of using this.
- Change for ... in on array to simple for for better performance. (http://jsperf.com/for-in-vs-for-loop-on-array)
- Move MetrilyxAnnotation creation inside MetrilyxGraph instead of using timeout, since the graph knows when it has been rendered
- Some JavaScript syntax correction.