Use `json` responses for BitBucket resource owner
Merge pull request #399 from stloyd/bugfix/bitbucket

Use `json` responses for BitBucket resource owner
Some cleanup of code:
- type-hint objects when possible,
- don't use container parameter in constructor
- reduce usage of container
- remove some code duplication
- made configuration a bit more readable
Refactor code to use Symfony OptionResolver component
Fix problem with twig extension after refactoring, cleanup after review