Feature text input with variable binding to reference

Allows users to create text input boxes with variable binding. Also simplified some recalculation of string bounds and fixed a some little issues with unfocus/unclick and calculating string bounds when strings contain spaces ' '.