Implement bitpos command.

This command landed in unstable today.
Tests are taken and translated from the original Tcl test suite.