improved error handling

The error handling before pretty much sucked. It was simply to print an
error when it was encountered and move on. To see if something went
wrong, the user has to check the log. Instead of this, each error is
returned from the function, like idiomatic Go. Errors are only logged
when it is intuitive to do so, and this helps the log message show where
the error actually occured (ex. All errors regarding files not being
found look alike, so if a function requests a file's contents and an error
is thrown, then that function will log the error because that's where the error
actually matters. If a bunch of FileNotFound errors pop up at the top of
the stack trace, then you can't tell where they originated.)