Major plugin improvements

This PR introduces major plugin improvements:
- Code was deeply refactored to make it more understandable
- Lot of unit and integration tests were added
- Added new features, including index builders