[SD-945] Improvements:
                        1. Reusing the variables instead of asking the dict() again.
                        2. Refactored few lines to a function().
                        3. Adding a behave test for testing Metadata
                        4. Anpa Category has to be dict type, not string
[SD-1051] Second Issue is fixed
[SD-668] Adding needs_activation to False for AD users and refactored the repetitive code to a function
Merge remote-tracking branch 'upstream/master'