Separate serialization from extraction code

I also added JSHint config