Modify service definition to match library code
Make bundle code testable, add tests