Code cleanup, mostly guided by NetBeans suggestions
Refactoring process model in to separate class

This allows to separate thinking about process model and algorithms on top of it.