Factory pattern for shape tools

Removed unstructured enum pattern and added factory pattern for shape
tools. The preparing (getting) of shapes is now implemented in the
specific shape tools. The shape tool factory returns the needed
shapetool based on the passed action command string.