General Code Cleanup

removed warnings
Refined Encoding

GetEncoding now returns a specialized encoder if encoding flag is Unicode and a BOM is detected
This encoder removes the BOM when converting to string and adds it again when converting
to a byte array.