Updated posts pre-processing image hotlinking

Update the posts pre-processing image hotlinking to replace the image
src with a url that points to the image cdn. The image src is only
substituted if the cdnUrl config option is setup.
Image Cdn server

Added an image cdn server that is run along with the main epochtalk
server. This image cdn server basically serves to act as a proxy to
route hotlinked images from another domain. This adds a layer of
security by putting all hotlinked images behind another domain. The
hotlink image urls are generated by the posts pre-processor. The url
scheme for images turns the generated urls into a url for the server to
retrieve the images from and pass on to the user.

The url scheme is as such /images/{method hash}/{url cipher}
The method hash indicates if this image is a hotlinked image. It is
basically just the word 'hotlink' with a sha256 hash.
The url cipher is the url of the image encrypted with AES256. This was
chosen because it can then be decrypted on the image cdn and the url can
be routed through the image server.
Updated post validation for merge conflict

There was a merge conflict for post validation. This fixes it to use the
proper syntax.
Expanded the editor to handle file uplaods

The Editor has been rewritten to allow more content and tools to fix
into the directive. The first step was to update the CSS to utilize
foundation. The second step was to updated the HTML and pull in the
editor and preview titles into the editor rather than have them defined
outside the editor every time.

One service and one extra directive was created to support file uploads.
The directive allows access to HTML5's File API to keep track of files
selected by the user from their hard drive. The service is a generic
upload service that uses FormData to upload the file to the image cdn
server. This may be removed later so that uploads go directly to s3.
Updated new Thread for updated editor

This commit updates the editor used on the new Thread page to match the
new version of the editor.
Removed upload to image cdn server code

Removing all code related to uploading straight to the image cdn server
in favor of starting work on uploading directly to s3 from the client.
Removed ng-cookies

It is not being used at all right now.
Removed the file_model directive

Removed the file model directive because the model for input type=file
is being handled by the editor directive itself
Updated the editor directive to handle s3 uploads

Updated the editor to handle s3 uploads.
Pulled s3 policy creation into main server

Moved the s3 policy creation route into the main server from the image
cdn server. This is to avoid issuing CORS from the image cdn server.
Also, authentication and configurations can all be kept on ther main
server.

The image cdn server was also updated to handle s3 uploaded image urls.
The image cdn server also replaced request with hapi.proxy because it
can be set to pass along the header from s3. The image module has also
switched to sha1 for image method param generation and the handling of
the image proxying has been tighten up a little bit as well.
Insert image into editor on upload complete

The image BBCode tag along with the link to the uploaded photo is
inserted into the editor upon upload completion.
Trigger file picker from link

Hid the ugly standard file picker and replaced it with a link that opens
the file picker instead. Added a function to the link's onclick event
handler that ends up programmatically clicking the file input element.
Editor: multiple images

Updated the editor to handle multiple images. This required adding the
"multiple" attribute to the input tag and treating the files that come
out of that tag as an array instead of just referencing the first
element in that fileList.
Editor: handle drag and drop uploads

Updated the editor to handle drag and drop uploads. This required making
the entire editor footer a drag and drop zone. The required event
listeners have been added to handle dragEnter, dragLeave, and drop. The
drop listener pulls out the file list from the drop event and calls the
upload function with an array of images.
Editor: handle images only

Updated the editor to handle only image uploads. The input[type=file]
was updated with an additional attribute 'accept="image/*"' and will
only accept images types now. The drag and drop implementation checks
the file type of each incoming file and only uploads files that are of
an image type.
Moved S3 image upload to a service

Moved all the code to upload to the S3 instance into a service so that
it can be shared with any other module. This includes the call to create
a new policy and the promise bindings for progress, complete, and
failed.
Added Images uploaded to editor footer

Added a section to the footer that shows the user the files being
uploaded and when the upload is done, the display updates with a link
to the uploaded file.

This commit also fixes a problem where the same file input's filelist is
not cleared after uploading. It is now cleared after each upload.
Button to insert image link into editor

Added a button that only shows up on a successful image upload to the
image progress display. This button will inject the image BBCode tag
with the proper image url embedded in it, into the editor. The icon for
the button needs to be updated at a later point.
Protect policy route with user auth

Added user authentication to the /policy route.
Renamed image_cdn to image_server

Renamed this directory to be clearer about its purpose.