Use topological sort on operations

Define dependencies before things that depend on them.
Merge pull request #3 from bradfeehan/features/reliable-dependencies

Sort operations topologically to prevent undefined operation errors for dependencies