Fix build to make it work on WildFly as well

Few fixes in build & properly split test code