Changes based on comments by @nikic

- Removed nails parameter
- Error when there is not enough input to read a full word size
- Declarations moved to the top as per C89 requirements
- Removed test cases related to nails
- More tests for error conditions