Fix whitespace and indenting errors

Full cleanup of whitespace including space to tab conversion and removal of trailing whitespace. Resolves #52.