Fixed bug 432147 - [refactoring] Extract Constant displays error message
on name of local variable

Better handling of initializer blocks and some small improvements based
on review.

Signed-off-by: Timo Kinnunen <timo.kinnunen@gmail.com>