Cleaned up the if statements

Using a ‘mixin’ to check for undefined. This also works for objects
within objects. Since it is only throwing one error, made it a bit more
DRY to just check if the passed in argument object values are undefined
or not.
Added test for isUndefined function.
Merge pull request #6 from agirton/feature/undefined-check

Cleaned up the if statements