Made the test work again + various changes

Hi,

Some places there are checks like this:

    if level <= debugLevel {
        return true
    }
    return false

Instead of just

    return level <= debugLevel

There are similar situations with error checks. This occured:

    if err = self.handleResponse(dst, res); err != nil {
        return err
    }
    return nil

Instead of just

    return self.handleResponse(dst, res)

There are also various other simplifications that results in less code (with less repetition) that does the same thing.

Also made main_test.go compile again and added a `defer` statement.

All tests pass.

Best regards,
Alexander Rødseth