Use refdb.
Fix labeling of figures.
Use cref for listings.