Fixes #293

Fixes #293: Improved code organization, improved type safety of variables, and improved coercion of variable values into types with given expressions. Added test suite for coercion to cover common cases.
The same parser is used here as for parsing SQL statements, so the only requirement is that your variable value is a valid SQL expression. There is a sole exception supported for string literals which do not have to be quoted, but that logic is executed only in the case when the type is known to be compatible with string and a strict SQL parsing fails.