Silicon photonic toolkit for integrated switching matrices