Use topological sorting for method lookup
Added -types option to print global vars types in console