Moved state node into search.js in preperation for using web workers.
Added search-worker code.