To add on to other answers you can look up the URL query string at layout time, not just callback time. I give some example code here: Example: Creating Multi-Page and Custom-Page apps at layout time
This would allow you to build something that immediately loads the correct state without having to wait for callbacks to load.