Re-factor to allow importing of ec2 inventory plugin

# Purpose
Update to allow import of inventory as library in other ansible modules. This save me from having to shell execute the ec2.py and `json.loads` the stdout.

# Tests
- [x] Tested normal execution from shell
- [x] Tested `--host` execute from shell
- [x] Test importation from other ansible library