Refactoring of core Preferenes.java: Using constants instead of literals
display known preference keys
code style: Curly Brackets
fix getPublicFieldsAndMethods vulnerable to NPE.

To reproduce:
map = ['id':'FX-11']
map.<tab>
===> java.lang.NullPointerException: Cannot get property 'fields' on null object
static method

Added someunit tests showing further problems with ReflectionCompleter,
Tests passing, bugs to be fixed in another commit
static typing
fix Class method completion

Example:
Math.ma<tab>

Before: no completion
After: Math.max(
code style: whitespace,
fix completion evaluating line during completion

This enables completing inside brackets, but disables completion
in certain cases of literal statements. As long evaluation cannot
be done safely, need to avoid evaluating statements that have side
effect.

Problematic case:

groovy:000> x = 4
===> 4
groovy:000> x += 1; "foo".<tab><tab><tab>
groovy:000> x
===> 7

Evaluating expressions for completions is not safe or sane.

The problem is that in order to find the instance
of the current context, the line start is not too helpful.

Example:
groovy:000> x = "3"
===> 3
groovy:000> String.toUpperCase(x.to<tab>

Before: no completion
After: toBigDecimal()   toBigInteger() ...
complete variable names and such inline even if dot precedes expression

example
groovy:000> xyz = 3
===> 3
groovy:000> System.out.println(x<tab>

Before: No completion
After: completes xyz
Fix display of superclass methods in completion

E.g.:
groovy:000> class Foo{}
===> true
groovy:000> Foo.<tab>

Before: super$1$xyz methods apper
after: methods appear under their name
Refactor: Use Set and extract Method to reflect on fields and methods
fix completion: do not show instance vars in static context,

Example:
groovy:000> class Foo{public static int foo = 3; int bar = 4}
===> true
groovy:000> Foo.<tab>loop over superclasses
extend completion: for method closures defined in the shell, add brackets

Example:
groovy:000> def boolean foo(String name, prefix) {return name == prefix}
===> true
groovy:000> fo<tab>
Small fix to completion of identifiers,
not evaluating identifiers following a point

Example:
groovy:000> class Foo{public static def fooprop = 3}
===> true
groovy:000> class Bar{public static def barprop = 3}
===> true
groovy:000> bar = new Bar()
===> Bar@53624517
groovy:000> foo = new Foo()
===> Foo@3000e213
groovy:000> bar.foo.<tab>

Before: completes like foo.<tab>
After: no completions
Keyword completion.

Hooked and into Reflection Completer, may suggest keywords in places they cannot appear.

Took some care to provide most probable spacing and some opening brackets.
code format
Complete Custom Classes.

Using the loaded classes stored in the shell

Example:
groovy:000> class BarFooBaz{}
===> true
groovy:000> Bar<tab>

Before: No completion
After:  groovy:000> BarFooBaz
Autoindent for buffers, currently fixed at 2 spaces.
Enabled by setting autoindent to true in preferences.

The current buffer is lexed using the default Groovy Lexer,
which keeps track of parentheses in a stack, using the depth of that stack.

Also had to use a hack-ish solution wrapping the InputStream because JLine
does not provide an API to do autoindent.
Whole-buffer context aware completion using lexer
Completes many but no all expressions where statement before dot
across multiple lines can be evaluated without side-effects
(literals, classes, fields and collections thereof, without parentheses).