A simple implementation of topological sorting in JavaScript. No dependencies. A cycle graph will throw an error.