Moved Litecoin code from gist.