add jar loader, refactor, add tests