bugfix: serialization should be binary only
works without gnuplot
Re-initialize curand RNG when changing device

Fixes #165
Merge pull request #6 from jonathantompson/master

added AbsCriterion (module comes courtesy of Ross Goroshin).
Merge pull request #166 from akfidjeland/curand-init

Re-initialize curand RNG when changing device
C89!!
TH: now C89
windows popen/pclose
windows missing functions
msvc flags: no wall (nightmare)
missing declarations
pkg/torch: C89
pkg/nn: C89
pkg/paths: C89
Remove noisy warnings with gcc47
Add support for QT term in gnuplot

This patch inserts 'qt' as terminal type for gnuplot for all OSes,
with lower precedence than 'wxt' but higher than 'x11'

Qt is a better alternative than x11, according to
[gnuplot 4.6.0 release notes](http://www.gnuplot.info/announce.4.6.0):

```
         NOTES TO PACKAGERS AND TESTERS
        ===============================

Configuration options for interactive use
-----------------------------------------

The 4.6 source code supports three primary cross-platform output modes
in addition to several platform-specific modes.

1) Cairo/pango/wxWidgets
   These terminals were introduced in version 4.4 and are now the most
   stable and full-featured option.  This set of terminals includes
   - pngcairo, pdfcairo, epscairo, and cairolatex for output to a file
   - wxt for interactive display
   This is the default configuration, but requires prior installation of
   libcairo, libpango, libcairo, libwxgtk, and related support libraries
   To disable these terminals:
       ./configure --disable-wxt --without-cairo

2) Qt
   The new qt terminal supports interactive display with menu-driven
   output to png, svg or pdf.
   Requires libqt version >= 4.5
       ./configure --enable-qt

3) X11 (the "classic" interactive interface)
   This used to be the preferred interactive interface, but the newer
   wxt and qt terminals offer nicer output and a wider range of features.
```
Merge pull request #170 from jucor/gnuplotqt

Add support for QT term in gnuplot
remove WeightedMSECriterion test since it fails with an unknown module
Merge remote-tracking branch 'upstream/master'
move k into thread private loop