Replaced tabs with spaces and added test file
More formatting changes
Added initial unit tests