Cleaned up JPA, more testing, stats in separate class