This changes pocket index calculation to support more than two pockets. As an example default number of pockets is set to 4. This should ease nesting more than two levels using pockets as temporary storage.
Signed-off-by: Igor Kovalenko igor.v.kovalenko@gmail.com