Added Tests and Cleaned up Functions in FileHandler