Package bencode refactored to use algorithms from package json.

	needs better tests