Added test GUI, basic query code + fixes