BF: Fix format string typo and ensure tobinary result is 8 characters long
Import quote and unquote directly from urllib