So when you visit user/XXX the router calls loadUser:
loadUser uses the input param to set the user_id
you could use the param to perform a query in firebase to map between a username and user_id
Although the consequence of that is that each username will have to be unique. Facebook makes user friendly user_ids by appending numbers to the basic name. So you would need to do something like check for collisions of usernames before assigning one.
I'd then change loadUser to use lookupByUsername instead of lookupUser
The fact usernames would have to be unique is awkward and would need some work to get right though.
Tom