Prediction And Understanding Of Functional Topological And Spintronic Materials From First Principles