modularized decoder

Decoder is now a module
fix command line initialization
removed training from main script