make use of path module from node core to make things more straightforward in code

Signed-off-by: Sean Wesenberg <wookets@gmail.com>