Only perform a database look up for bare JIDs

Also return direct to full JIDs or domains. 

Fixes #232