rename package codec.frame to codec
Fix to check SelectionKey validity

Close operation should not be executed when the SelectionKey is
invalid.
Add methods indexOf()/lastIndexOf()
Fix CodecBuffer#readBytes() not to throw Exception

Returing the length of read byte is more easy to control than
the throwing exception.
Change flush interface to the nio channel

BufferSink#transferTo() accepts GatheringByteChannel as its argument
to flush buffers at once if possible.
BufferSink#addFirst() and #addLast() insert its argument into the
BufferSink. These methods are added to achive CompositeCodecBuffer,
not implemented yet.