writing bvh parser as an object and some cleanup