move credential encoding to PebbleBucks.URLCredentials

modify PebbleBucks.onShowConfiguration and PebbleBucks.fetchData to use this new function