Add toposort feature to module-deps.pl

Change-Id: Id839eae62ad53189c44f7ca5a498bf7113c2536a