small update (to speedup a little the sample implementation of isPrime), and add a sample using a Companion object (with implicit methods inside)