Extract path related classes to path module

Also added some behavior to those classes