Refactored to make it testable & added basic tests
added code + example config to manifest