[DependencyInjection] Fix Container::camelize to convert beginning and ending . and _

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7431
| License       | MIT
| Doc PR        | n/a

I'm using strtr to make the conversion in order to ensure that the behavior is the same as `Container::get`.

From the test cases I've added, the following were not passing: