a simple utility function for getting a value at a path from an object with all the usecases properly covered