Implemented managing bots, and a system for regex filters

Refers to issue #16

Modified files:
> htdocs/autoHTML.tmpl
> modules/autohandler.py
> modules/irc.py
> modules/remotes.py
> modules/rpchandler.py
> modules/sites/ptp.py
> modules/sites/test.py
> static/scss/auto.scss (==> static/css/auto.css)
> static/javascript/auto.js

htdocs/autoHTML.tmpl
> Removed form from modal dialog to prevent accidental submission

modules/autohandler.py
> Added methods: get_source_single, stop_bot,
> get_filters, add_filter, and remove_filter
>
> get_source_single
>  Performs the same role as get_sources, but for a single name (should
>  try to unify both of these under a single function in the future)
>
> stop_bot
>  Sends a SIGTERM to a running bot instance
>
> get_filters
>  Returns stored filters for given handler name, or an empty list
>
> add_filter
>  Validates and adds a regex filter for given handler name
>
> remove_filter
>  Removes a regex filter from given handler name (NOTE: not persistent,
>  will be fixed in next commit)
>
> Modified 'remote_row' status <td> to be easily referrable by handler
> name
>
> Added two items to drop downs, filters and botcontrols
> These allow viewing, and editing of regex filters and starting and
> stopping IRC bots
>
> Added the requirement to specify key descriptions for 'required_keys'
> which are displayed as placeholders (see modules/sites/ptp.py below)
>
> Modified start_bot function to check for errors when starting IRC
> instances

modules/irc.py
> Added an update function to fetch any changes in defined handler
> filters, this is called on every pubmsg in defined channels
>
> Fixed shutdown sequence to really remove PID files, and to report this
> back to the main process
>
> Added handling for nicknameinuse and erroneousnickname server
> responses (response is to die)
>
> Added registration and deregistration with the main process, allowing
> other components of the app to hook into running instances
>
> Added sending of arbritrary startup commands as defined in the handler
> module file
>
> Implented regex matching of PRIVMSGs to the configured channel, and
> parsing of a torrent id from this based on the handler module file
> defined regex
> This torrent id is then passed back to the main process for
> downloading
>
> Made the Irc class fully configurable via the attributes of the
> handler module file

modules/remotes.py
> Added new functions: addFilter, removeFilter, registerBot,
> deregisterBot, isBotActive
>
> addFilter
>  Adds a regex filter to storage, which has been compiled into a re
>  object already
>
> removeFilter
>  Removes a filter from storage (NOTE: this will be updated in the next
>  commit to actually save changes to disk)
>
> registerBot
>  Stores the PID of a running IRC bot, this is not persistent storage,
>  all bots should be dead between restarts
>
> deregisterBot
>  Removes the PID of a dying IRC bot
>
> isBotActive
>  Returns the PID of a running bot instance based on the given handler
>  name
>
> Forced all names to be accessed, and stored, in uppercase

modules/rpchandler.py
> Added new methods: register, deregister, and get_filters
>
> register
>  Calls remotes.registerBot
>
> deregister
>  Calls remotes.deregisterBot
>
> get_filters
>  Returns a list of filters for a given handler name

modules/sites/ptp.py
> Added significant changes to approach
>
> REQUIRED_KEYS atribute of the module now must be a list of tuples, the
> first element being the required key, and the second being a
> description of that key
>
> Added the METHODS attribute of the module
> This defines which auto method(s) should be used for auto-downloading,
> this currently can only be IRC, but RSS and WEB downloads are planned
>
> If the IRC method is specified, four more attributes must be defined:
> IRC_NETWORK
>  the network address that the bot should connect to
> IRC_PORT
>  the port that the bot should connect to
> IRC_CHANNEL
>  the announce channel that the bot should join
> IRC_MATCH
>  a compiled re object that will match an announce message, and extract
>  the relevant information as the first matched group, any post
>  processing can be defined in the fetch function of the Main class
>
> A fifth attribute can be optionally defined
> IRC_COMMANDS
>  This is a list of RAW IRC messages that can be sent directly after
>  the bot has connected, for example, this might include identifying to
>  Services

static/javascript/auto.js
> Significant changes
> Added communication of multiple commands / actions with autohandler
>
> Clicking a bot_button will start or stop a bot instance
>
> Clicking an add_filter button will add that filter
>
> Clicking on an existing filter will confirm, and then remove that
> filter
>
> Added auto refreshing of the drop_down on certain command responses,
> via two new functions: refresh_drop_down, and
> refresh_drop_down_respond
>
> refresh_drop_down
>  Sends a request for a new drop_down using the autohandler
>  get_source_single method
>
> refresh_drop_down_respond
>  Async callback for the refresh_drop_down, actually changes the DOM

static/scss/auto.scss (==> static/css/auto.css)
> A whole load of styling changes for all the new features on /auto